diff options
author | paramat <paramat@users.noreply.github.com> | 2018-02-17 17:43:13 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2018-02-20 15:25:37 +0000 |
commit | 2bc7c5ff93859489c57c055cafb4d75146e062b3 (patch) | |
tree | b28fda78d419826b29784b0e809846fb2c027f10 /src/mapgen/mapgen_v5.cpp | |
parent | 0f015b28a30f77e006528a36c8d5b7705b0d6423 (diff) | |
download | minetest-2bc7c5ff93859489c57c055cafb4d75146e062b3.tar.gz minetest-2bc7c5ff93859489c57c055cafb4d75146e062b3.tar.bz2 minetest-2bc7c5ff93859489c57c055cafb4d75146e062b3.zip |
Dungeons: Add Y limits in all mapgens
Preserve the upper limit used in mgvalleys.
Diffstat (limited to 'src/mapgen/mapgen_v5.cpp')
-rw-r--r-- | src/mapgen/mapgen_v5.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mapgen/mapgen_v5.cpp b/src/mapgen/mapgen_v5.cpp index 89c65cc20..2e788e8f1 100644 --- a/src/mapgen/mapgen_v5.cpp +++ b/src/mapgen/mapgen_v5.cpp @@ -55,6 +55,8 @@ MapgenV5::MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge) 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; // Terrain noise noise_filler_depth = new Noise(¶ms->np_filler_depth, seed, csize.X, csize.Z); @@ -101,6 +103,8 @@ void MapgenV5Params::readParams(const Settings *settings) settings->getS16NoEx("mgv5_cavern_limit", cavern_limit); settings->getS16NoEx("mgv5_cavern_taper", cavern_taper); settings->getFloatNoEx("mgv5_cavern_threshold", cavern_threshold); + settings->getS16NoEx("mgv5_dungeon_ymin", dungeon_ymin); + settings->getS16NoEx("mgv5_dungeon_ymax", dungeon_ymax); settings->getNoiseParams("mgv5_np_filler_depth", np_filler_depth); settings->getNoiseParams("mgv5_np_factor", np_factor); @@ -121,6 +125,8 @@ void MapgenV5Params::writeParams(Settings *settings) const settings->setS16("mgv5_cavern_limit", cavern_limit); settings->setS16("mgv5_cavern_taper", cavern_taper); settings->setFloat("mgv5_cavern_threshold", cavern_threshold); + settings->setS16("mgv5_dungeon_ymin", dungeon_ymin); + settings->setS16("mgv5_dungeon_ymax", dungeon_ymax); settings->setNoiseParams("mgv5_np_filler_depth", np_filler_depth); settings->setNoiseParams("mgv5_np_factor", np_factor); @@ -223,7 +229,8 @@ void MapgenV5::makeChunk(BlockMakeData *data) } // Generate dungeons and desert temples - if (flags & MG_DUNGEONS) + if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin && + full_node_max.Y <= dungeon_ymax) generateDungeons(stone_surface_max_y, mgstone_type, biome_stone); // Generate the registered decorations |