Fix deep ground cave generation a bit
authorPerttu Ahola <celeron55@gmail.com>
Fri, 3 Feb 2012 13:19:05 +0000 (15:19 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 27 Mar 2012 16:09:08 +0000 (19:09 +0300)
src/mapgen.cpp

index 0dfd6731212cac0f98adc0adcb86ce9db30e4e94..c6893eed79055dbec7c5c0063ab7012406e7f675 100644 (file)
@@ -1416,12 +1416,14 @@ void make_block(BlockMakeData *data)
                        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);
                        }