//double gen_area_nodes = MAP_BLOCKSIZE*MAP_BLOCKSIZE * rel_volume;
// Horribly wrong heuristic, but better than nothing
- bool block_is_underground = (WATER_LEVEL /* local minimum ground level */ >
- MAP_BLOCKSIZE * (data->blockpos_max.X
- - data->blockpos_min.X + 1) / 2);
+ bool block_is_underground = (WATER_LEVEL > node_max.Y);
/*
Create a block-specific seed
u32 i = vmanip.m_area.index(v3s16(p2d.X, node_min.Y, p2d.Y));
for(s16 y=node_min.Y; y<=node_max.Y; y++)
{
- if(y <= surface_y)
- vmanip.m_data[i] = MapNode(c_stone);
- else if(y <= WATER_LEVEL)
+ if(y <= surface_y){
+ if(vmanip.m_data[i].getContent() == CONTENT_IGNORE)
+ vmanip.m_data[i] = MapNode(c_stone);
+ } else if(y <= WATER_LEVEL){
vmanip.m_data[i] = MapNode(c_water_source);
- else
+ } else {
vmanip.m_data[i] = MapNode(c_air);
+ }
vmanip.m_area.add_y(em, i, 1);
}
u32 bruises_count = volume_nodes * stone_surface_max_y / 40000000;
if(stone_surface_max_y < WATER_LEVEL - 20)
bruises_count = 0;
- /*u32 caves_count = 0;
- u32 bruises_count = 0;*/
for(u32 jj=0; jj<caves_count+bruises_count; jj++)
{
s16 min_tunnel_diameter = 2;
- s16 max_tunnel_diameter = 5;
+ s16 max_tunnel_diameter = myrand_range(4,5);
u16 tunnel_routepoints = 20;
v3f main_direction(0,0,0);