aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-03-29 13:18:09 -0400
committerkwolekr <kwolekr@minetest.net>2013-03-29 13:18:09 -0400
commit5b854f95d2144710493520151aafc48a887ac1b3 (patch)
tree77a79e66de83ce91629c3bbce138d8832daa9165 /src
parentb0f39da131bc24a41c5d5c8a03d06192937a4568 (diff)
downloadminetest-5b854f95d2144710493520151aafc48a887ac1b3.tar.gz
minetest-5b854f95d2144710493520151aafc48a887ac1b3.tar.bz2
minetest-5b854f95d2144710493520151aafc48a887ac1b3.zip
Fix last singlenode modification
Diffstat (limited to 'src')
-rw-r--r--src/mapgen_singlenode.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mapgen_singlenode.cpp b/src/mapgen_singlenode.cpp
index 7fa56eaf1..22b756abb 100644
--- a/src/mapgen_singlenode.cpp
+++ b/src/mapgen_singlenode.cpp
@@ -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