Fix last singlenode modification
authorkwolekr <kwolekr@minetest.net>
Fri, 29 Mar 2013 17:18:09 +0000 (13:18 -0400)
committerkwolekr <kwolekr@minetest.net>
Fri, 29 Mar 2013 17:18:09 +0000 (13:18 -0400)
src/mapgen_singlenode.cpp

index 7fa56eaf14bfbdd015b1bd7f2fe6f32ee619e4c1..22b756abba513de587b7ff01846dcc71f6f84b64 100644 (file)
@@ -76,14 +76,15 @@ void MapgenSinglenode::makeChunk(BlockMakeData *data) {
                c_node = CONTENT_AIR;
        
        MapNode n_node(c_node);
-       int i = 0;
        
-       for (s16 z=node_min.Z; z<=node_max.Z; z++)
-       for (s16 y=node_min.Y; y<=node_max.Y; y++)
-       for (s16 x=node_min.X; x<=node_max.X; x++) {
-               if (vm->m_data[i].getContent() == CONTENT_IGNORE)
-                       vm->m_data[i] = n_node;
-               i++;
+       for (s16 z = node_min.Z; z <= node_max.Z; z++)
+       for (s16 y = node_min.Y; y <= node_max.Y; y++) {
+               u32 i = vm->m_area.index(node_min.X, y, z);
+               for (s16 x = node_min.X; x <= node_max.X; x++) {
+                       if (vm->m_data[i].getContent() == CONTENT_IGNORE)
+                               vm->m_data[i] = n_node;
+                       i++;
+               }
        }
 
        // Add top and bottom side of water to transforming_liquid queue