summaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.cpp
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2019-11-09 02:09:52 +0000
committerGitHub <noreply@github.com>2019-11-09 02:09:52 +0000
commit29a4a8e5af53dfbf1cbec14de4cbe8d807223e1c (patch)
tree59cc48a96c8e66346d43a3adc356114d617c1266 /src/mapgen/mapgen.cpp
parentd11bfa3ef5e8d63068096c52bc2faccba65b0b47 (diff)
downloadminetest-29a4a8e5af53dfbf1cbec14de4cbe8d807223e1c.tar.gz
minetest-29a4a8e5af53dfbf1cbec14de4cbe8d807223e1c.tar.bz2
minetest-29a4a8e5af53dfbf1cbec14de4cbe8d807223e1c.zip
Tunnels: Completely disable generation when 'cave width' >= 10.0 (#9093)
Previously, the only way to disable the 3D noise tunnels was to set 'cave width' > 1.0, however doing so did not disable the very intensive noise calculations or the generation loop. All the other types of cave generation (randomwalk caves, caverns) can already be independently and completely disabled. This feature is now needed more because the small randomwalk caves are now available for use as an alternative to the 3D noise tunnels.
Diffstat (limited to 'src/mapgen/mapgen.cpp')
-rw-r--r--src/mapgen/mapgen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index a1ac7a5ca..bd074d158 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -831,7 +831,9 @@ void MapgenBasic::dustTopNodes()
void MapgenBasic::generateCavesNoiseIntersection(s16 max_stone_y)
{
- if (node_min.Y > max_stone_y)
+ // cave_width >= 10 is used to disable generation and avoid the intensive
+ // 3D noise calculations. Tunnels already have zero width when cave_width > 1.
+ if (node_min.Y > max_stone_y || cave_width >= 10.0f)
return;
CavesNoiseIntersection caves_noise(ndef, m_bmgr, csize,