aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2019-11-22 20:37:43 +0000
committerParamat <paramat@users.noreply.github.com>2019-11-23 01:41:27 +0000
commit154080c8836942e438124af35cfc57ef1f304e73 (patch)
tree63ae62ed3a704f2fac4be57f7706540e3a3257c9 /src
parentec5f59101428d66ce716143fedd34445a4fdcac0 (diff)
downloadminetest-154080c8836942e438124af35cfc57ef1f304e73.tar.gz
minetest-154080c8836942e438124af35cfc57ef1f304e73.tar.bz2
minetest-154080c8836942e438124af35cfc57ef1f304e73.zip
Caves: Fix shadowing of 'large_cave_depth' to avoid confusion
Diffstat (limited to 'src')
-rw-r--r--src/mapgen/mapgen.cpp8
-rw-r--r--src/mapgen/mapgen.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index 5c6a95a82..81ccf1f8d 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -843,7 +843,7 @@ void MapgenBasic::generateCavesNoiseIntersection(s16 max_stone_y)
}
-void MapgenBasic::generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_depth)
+void MapgenBasic::generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_ymax)
{
if (node_min.Y > max_stone_y)
return;
@@ -858,10 +858,12 @@ void MapgenBasic::generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_depth)
cave.makeCave(vm, node_min, node_max, &ps, false, max_stone_y, heightmap);
}
- if (node_max.Y > large_cave_depth)
+ if (node_max.Y > large_cave_ymax)
return;
- // Large randomwalk caves below 'large_cave_depth'
+ // Large randomwalk caves below 'large_cave_ymax'.
+ // 'large_cave_ymax' can differ from the 'large_cave_depth' mapgen parameter,
+ // it is set to world base to disable large caves in or near caverns.
u32 num_large_caves = ps.range(large_cave_num_min, large_cave_num_max);
for (u32 i = 0; i < num_large_caves; i++) {
diff --git a/src/mapgen/mapgen.h b/src/mapgen/mapgen.h
index a44a8dd3b..1473d41a6 100644
--- a/src/mapgen/mapgen.h
+++ b/src/mapgen/mapgen.h
@@ -244,7 +244,7 @@ public:
virtual void generateBiomes();
virtual void dustTopNodes();
virtual void generateCavesNoiseIntersection(s16 max_stone_y);
- virtual void generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_depth);
+ virtual void generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_ymax);
virtual bool generateCavernsNoise(s16 max_stone_y);
virtual void generateDungeons(s16 max_stone_y);