diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-04-29 07:20:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-29 07:20:46 +0100 |
commit | 54606e103d5b2d2bace6d57c45e48804c5dec487 (patch) | |
tree | 013c8ad66dfcc60c2ccb947c7e2c6cf030fcedde /src/mapgen/mapgen_v7.cpp | |
parent | bb3baef30f8afcfec046050b1ef3b606a2c1248a (diff) | |
download | minetest-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_v7.cpp')
-rw-r--r-- | src/mapgen/mapgen_v7.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mapgen/mapgen_v7.cpp b/src/mapgen/mapgen_v7.cpp index c83a5105d..23e8dbdd2 100644 --- a/src/mapgen/mapgen_v7.cpp +++ b/src/mapgen/mapgen_v7.cpp @@ -313,20 +313,25 @@ void MapgenV7::makeChunk(BlockMakeData *data) biomegen->calcBiomeNoise(node_min); generateBiomes(); - // Generate caverns, tunnels and classic caves + // Generate tunnels, caverns and large randomwalk caves if (flags & MG_CAVES) { - bool near_cavern = false; + // Generate tunnels first as caverns confuse them + generateCavesNoiseIntersection(stone_surface_max_y); + // Generate caverns + bool near_cavern = false; if (spflags & MGV7_CAVERNS) - near_cavern = generateCaverns(stone_surface_max_y); - // Generate tunnels and classic caves + near_cavern = generateCavernsNoise(stone_surface_max_y); + + // Generate large randomwalk caves if (near_cavern) - // Disable classic caves in this mapchunk by setting + // Disable large randomwalk caves in this mapchunk by setting // 'large cave depth' to world base. Avoids excessive liquid in // large caverns and floating blobs of overgenerated liquid. - generateCaves(stone_surface_max_y, -MAX_MAP_GENERATION_LIMIT); + generateCavesRandomWalk(stone_surface_max_y, + -MAX_MAP_GENERATION_LIMIT); else - generateCaves(stone_surface_max_y, large_cave_depth); + generateCavesRandomWalk(stone_surface_max_y, large_cave_depth); } // Generate dungeons |