diff options
author | paramat <mat.gregory@virginmedia.com> | 2015-03-20 18:06:05 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2015-03-22 19:30:08 +0000 |
commit | d6638b4300b091275fa25c43eaee42cd6d13effe (patch) | |
tree | 654aedfb7f7cba7c540aab1fa3815e43a13b6cd8 /src/mapgen_v5.cpp | |
parent | 008d7e0467a30f78e0c1a707be0c34aaa884732c (diff) | |
download | minetest-d6638b4300b091275fa25c43eaee42cd6d13effe.tar.gz minetest-d6638b4300b091275fa25c43eaee42cd6d13effe.tar.bz2 minetest-d6638b4300b091275fa25c43eaee42cd6d13effe.zip |
Mgv7: 1 up , 1 down overgeneration for chunk border continuity
Fixes biome layer at y = 47 when base/alt terrain exceeds it
Also fixes missing dust glitch at y = 47
Mgv5/mgv7:Cleanup code
Diffstat (limited to 'src/mapgen_v5.cpp')
-rw-r--r-- | src/mapgen_v5.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/mapgen_v5.cpp b/src/mapgen_v5.cpp index 9086acc37..240ae500a 100644 --- a/src/mapgen_v5.cpp +++ b/src/mapgen_v5.cpp @@ -377,9 +377,9 @@ int MapgenV5::generateBaseTerrain() stone_surface_max_y = y; } } - index2d = index2d - ystride; + index2d -= ystride; } - index2d = index2d + ystride; + index2d += ystride; } return stone_surface_max_y; @@ -391,10 +391,6 @@ bool MapgenV5::generateBiomes(float *heat_map, float *humidity_map) if (node_max.Y < water_level) return false; - MapNode n_air(CONTENT_AIR); - MapNode n_stone(c_stone); - MapNode n_water(c_water_source); - v3s16 em = vm->m_area.getExtent(); u32 index = 0; bool desert_stone = false; @@ -496,9 +492,9 @@ void MapgenV5::generateCaves(int max_stone_y) if (d1*d2 > 0.125) vm->m_data[i] = MapNode(CONTENT_AIR); } - index2d = index2d - ystride; + index2d -= ystride; } - index2d = index2d + ystride; + index2d += ystride; } if (node_max.Y > LARGE_CAVE_DEPTH) @@ -528,27 +524,25 @@ void MapgenV5::dustTopNodes() if (biome->c_dust == CONTENT_IGNORE) continue; - s16 y_full_max = full_node_max.Y; - u32 vi_full_max = vm->m_area.index(x, y_full_max, z); - content_t c_full_max = vm->m_data[vi_full_max].getContent(); + u32 vi = vm->m_area.index(x, full_node_max.Y, z); + content_t c_full_max = vm->m_data[vi].getContent(); s16 y_start; if (c_full_max == CONTENT_AIR) { - y_start = y_full_max - 1; + y_start = full_node_max.Y - 1; } else if (c_full_max == CONTENT_IGNORE) { - s16 y_max = node_max.Y; - u32 vi_max = vm->m_area.index(x, y_max, z); - content_t c_max = vm->m_data[vi_max].getContent(); + vi = vm->m_area.index(x, node_max.Y + 1, z); + content_t c_max = vm->m_data[vi].getContent(); if (c_max == CONTENT_AIR) - y_start = y_max - 1; + y_start = node_max.Y; else continue; } else { continue; } - u32 vi = vm->m_area.index(x, y_start, z); + vi = vm->m_area.index(x, y_start, z); for (s16 y = y_start; y >= node_min.Y - 1; y--) { if (vm->m_data[vi].getContent() != CONTENT_AIR) break; |