summaryrefslogtreecommitdiff
path: root/src/mapgen_flat.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2016-03-19 19:10:37 +0000
committerparamat <mat.gregory@virginmedia.com>2016-03-21 17:42:13 +0000
commit493a298c0c94d03cdcdb4a52684094f88cbd48c5 (patch)
treef2563547df31177af67531873201c42ec3105727 /src/mapgen_flat.cpp
parent93887043d9443ba6627fea68921994d0f1896517 (diff)
downloadminetest-493a298c0c94d03cdcdb4a52684094f88cbd48c5.tar.gz
minetest-493a298c0c94d03cdcdb4a52684094f88cbd48c5.tar.bz2
minetest-493a298c0c94d03cdcdb4a52684094f88cbd48c5.zip
Mgv7/flat/fractal: Stop tunnel-floor biome nodes being placed everywhere
A bool for 'in or under tunnel' was missing 1-node-deep stone ledges were being replaced with biome surface material
Diffstat (limited to 'src/mapgen_flat.cpp')
-rw-r--r--src/mapgen_flat.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mapgen_flat.cpp b/src/mapgen_flat.cpp
index d654a772e..7a5302df0 100644
--- a/src/mapgen_flat.cpp
+++ b/src/mapgen_flat.cpp
@@ -565,6 +565,7 @@ void MapgenFlat::generateCaves(s16 max_stone_y)
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index2d++) {
bool column_is_open = false; // Is column open to overground
+ bool is_tunnel = false; // Is tunnel or tunnel floor
u32 vi = vm->m_area.index(x, node_max.Y + 1, z);
u32 index3d = (z - node_min.Z) * zstride + (csize.Y + 1) * ystride +
(x - node_min.X);
@@ -591,13 +592,16 @@ void MapgenFlat::generateCaves(s16 max_stone_y)
if (d1 * d2 > 0.3f && ndef->get(c).is_ground_content) {
// In tunnel and ground content, excavate
vm->m_data[vi] = MapNode(CONTENT_AIR);
- } else if (column_is_open &&
+ is_tunnel = true;
+ } else if (is_tunnel && column_is_open &&
(c == biome->c_filler || c == biome->c_stone)) {
// Tunnel entrance floor
vm->m_data[vi] = MapNode(biome->c_top);
column_is_open = false;
+ is_tunnel = false;
} else {
column_is_open = false;
+ is_tunnel = false;
}
}
}