aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen_flat.cpp
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-04-29 07:20:46 +0100
committerGitHub <noreply@github.com>2018-04-29 07:20:46 +0100
commit54606e103d5b2d2bace6d57c45e48804c5dec487 (patch)
tree013c8ad66dfcc60c2ccb947c7e2c6cf030fcedde /src/mapgen/mapgen_flat.cpp
parentbb3baef30f8afcfec046050b1ef3b606a2c1248a (diff)
downloadminetest-54606e103d5b2d2bace6d57c45e48804c5dec487.tar.gz
minetest-54606e103d5b2d2bace6d57c45e48804c5dec487.tar.bz2
minetest-54606e103d5b2d2bace6d57c45e48804c5dec487.zip
Mapgen caves: Re-order generation to fix cavern bug
Previously, caverns confused tunnel generation causing biome top and filler nodes to appear in caverns. Split 'generateCaves()' into 2 functions to separate tunnel and large randomwalk cave generation. In each mapgen re-order cave generation to generate tunnels before caverns.
Diffstat (limited to 'src/mapgen/mapgen_flat.cpp')
-rw-r--r--src/mapgen/mapgen_flat.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mapgen/mapgen_flat.cpp b/src/mapgen/mapgen_flat.cpp
index 60b30137b..dbe0bd5bb 100644
--- a/src/mapgen/mapgen_flat.cpp
+++ b/src/mapgen/mapgen_flat.cpp
@@ -198,8 +198,12 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
biomegen->calcBiomeNoise(node_min);
generateBiomes();
- if (flags & MG_CAVES)
- generateCaves(stone_surface_max_y, large_cave_depth);
+ if (flags & MG_CAVES) {
+ // Generate tunnels
+ generateCavesNoiseIntersection(stone_surface_max_y);
+ // Generate large randomwalk caves
+ generateCavesRandomWalk(stone_surface_max_y, large_cave_depth);
+ }
if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin &&
full_node_max.Y <= dungeon_ymax)