aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen_v7.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/mapgen_v7.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/mapgen_v7.cpp')
-rw-r--r--src/mapgen/mapgen_v7.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/mapgen/mapgen_v7.cpp b/src/mapgen/mapgen_v7.cpp
index c9568760f..eaaff6ac6 100644
--- a/src/mapgen/mapgen_v7.cpp
+++ b/src/mapgen/mapgen_v7.cpp
@@ -62,14 +62,19 @@ MapgenV7::MapgenV7(MapgenV7Params *params, EmergeManager *emerge)
floatland_level = params->floatland_level;
shadow_limit = params->shadow_limit;
- cave_width = params->cave_width;
- large_cave_depth = params->large_cave_depth;
- lava_depth = params->lava_depth;
- cavern_limit = params->cavern_limit;
- cavern_taper = params->cavern_taper;
- cavern_threshold = params->cavern_threshold;
- dungeon_ymin = params->dungeon_ymin;
- dungeon_ymax = params->dungeon_ymax;
+ cave_width = params->cave_width;
+ large_cave_depth = params->large_cave_depth;
+ lava_depth = params->lava_depth;
+ small_cave_num_min = params->small_cave_num_min;
+ small_cave_num_max = params->small_cave_num_max;
+ large_cave_num_min = params->large_cave_num_min;
+ large_cave_num_max = params->large_cave_num_max;
+ large_cave_flooded = params->large_cave_flooded;
+ cavern_limit = params->cavern_limit;
+ cavern_taper = params->cavern_taper;
+ cavern_threshold = params->cavern_threshold;
+ dungeon_ymin = params->dungeon_ymin;
+ dungeon_ymax = params->dungeon_ymax;
// This is to avoid a divide-by-zero.
// Parameter will be saved to map_meta.txt in limited form.
@@ -173,6 +178,11 @@ void MapgenV7Params::readParams(const Settings *settings)
settings->getFloatNoEx("mgv7_cave_width", cave_width);
settings->getS16NoEx("mgv7_large_cave_depth", large_cave_depth);
settings->getS16NoEx("mgv7_lava_depth", lava_depth);
+ settings->getU16NoEx("mgv7_small_cave_num_min", small_cave_num_min);
+ settings->getU16NoEx("mgv7_small_cave_num_max", small_cave_num_max);
+ settings->getU16NoEx("mgv7_large_cave_num_min", large_cave_num_min);
+ settings->getU16NoEx("mgv7_large_cave_num_max", large_cave_num_max);
+ settings->getFloatNoEx("mgv7_large_cave_flooded", large_cave_flooded);
settings->getFloatNoEx("mgv7_float_mount_density", float_mount_density);
settings->getFloatNoEx("mgv7_float_mount_height", float_mount_height);
settings->getFloatNoEx("mgv7_float_mount_exponent", float_mount_exponent);
@@ -209,6 +219,11 @@ void MapgenV7Params::writeParams(Settings *settings) const
settings->setFloat("mgv7_cave_width", cave_width);
settings->setS16("mgv7_large_cave_depth", large_cave_depth);
settings->setS16("mgv7_lava_depth", lava_depth);
+ settings->setU16("mgv7_small_cave_num_min", small_cave_num_min);
+ settings->setU16("mgv7_small_cave_num_max", small_cave_num_max);
+ settings->setU16("mgv7_large_cave_num_min", large_cave_num_min);
+ settings->setU16("mgv7_large_cave_num_max", large_cave_num_max);
+ settings->setFloat("mgv7_large_cave_flooded", large_cave_flooded);
settings->setFloat("mgv7_float_mount_density", float_mount_density);
settings->setFloat("mgv7_float_mount_height", float_mount_height);
settings->setFloat("mgv7_float_mount_exponent", float_mount_exponent);