summaryrefslogtreecommitdiff
path: root/src/mapgen/cavegen.cpp
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2019-11-08 03:09:43 +0000
committerGitHub <noreply@github.com>2019-11-08 03:09:43 +0000
commit2a74727857a9bfd950ce1e6a58e0ade879033574 (patch)
treefcb59f922de4336a9a7abf37842567089d1638e9 /src/mapgen/cavegen.cpp
parent5506e97ed897dde2d4820fe1b021a4622bae03b3 (diff)
downloadminetest-2a74727857a9bfd950ce1e6a58e0ade879033574.tar.gz
minetest-2a74727857a9bfd950ce1e6a58e0ade879033574.tar.bz2
minetest-2a74727857a9bfd950ce1e6a58e0ade879033574.zip
Randomwalk caves: Add parameters for number, proportion flooded. Allow small caves (#8928)
Add mapgen parameters to set the range of the random number of randomwalk caves per mapchunk, and to set the proportion that are flooded with liquids. Default values are, for now, unchanged from the previous hardcoded values. Add parameters to allow small randomwalk caves Disabled by default for now as they have never been present in the non-mgv6 mapgens.
Diffstat (limited to 'src/mapgen/cavegen.cpp')
-rw-r--r--src/mapgen/cavegen.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mapgen/cavegen.cpp b/src/mapgen/cavegen.cpp
index 21540d7ce..2e2a1bbe3 100644
--- a/src/mapgen/cavegen.cpp
+++ b/src/mapgen/cavegen.cpp
@@ -280,18 +280,20 @@ CavesRandomWalk::CavesRandomWalk(
int water_level,
content_t water_source,
content_t lava_source,
+ float large_cave_flooded,
int lava_depth,
BiomeGen *biomegen)
{
assert(ndef);
- this->ndef = ndef;
- this->gennotify = gennotify;
- this->seed = seed;
- this->water_level = water_level;
- this->np_caveliquids = &nparams_caveliquids;
- this->lava_depth = lava_depth;
- this->bmgn = biomegen;
+ this->ndef = ndef;
+ this->gennotify = gennotify;
+ this->seed = seed;
+ this->water_level = water_level;
+ this->np_caveliquids = &nparams_caveliquids;
+ this->large_cave_flooded = large_cave_flooded;
+ this->lava_depth = lava_depth;
+ this->bmgn = biomegen;
c_water_source = water_source;
if (c_water_source == CONTENT_IGNORE)
@@ -322,7 +324,7 @@ void CavesRandomWalk::makeCave(MMVManip *vm, v3s16 nmin, v3s16 nmax,
this->ystride = nmax.X - nmin.X + 1;
- flooded = ps->range(1, 2) == 2;
+ flooded = ps->range(1, 1000) <= large_cave_flooded * 1000.0f;
// If flooded:
// Get biome at mapchunk midpoint. If cave liquid defined for biome, use it.