aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen_v6.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2020-01-25 16:56:54 +0100
committerGitHub <noreply@github.com>2020-01-25 16:56:54 +0100
commitcde2a7f6f24f638421238ead4e61b155322fefc8 (patch)
tree96b6b1dd00a0c14660eea6f3f518b5d832dc1bd8 /src/mapgen/mapgen_v6.cpp
parent9cb3219f34be983e1b84a62a64c25e137d587365 (diff)
downloadminetest-cde2a7f6f24f638421238ead4e61b155322fefc8.tar.gz
minetest-cde2a7f6f24f638421238ead4e61b155322fefc8.tar.bz2
minetest-cde2a7f6f24f638421238ead4e61b155322fefc8.zip
Settings: Add get_flags API for mapgen flags (mg_flags, mgv6_spflags, ...) (#9284)
Unified flags handling in C++ and Lua Settings API -> Reading only, for now. Writing can be implemented later, if needed. API function to read the currently active flags -> was impossible from Lua Co-authored-by: Wuzzy <wuzzy2@mail.ru>
Diffstat (limited to 'src/mapgen/mapgen_v6.cpp')
-rw-r--r--src/mapgen/mapgen_v6.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mapgen/mapgen_v6.cpp b/src/mapgen/mapgen_v6.cpp
index 4e876fc53..653adc8ec 100644
--- a/src/mapgen/mapgen_v6.cpp
+++ b/src/mapgen/mapgen_v6.cpp
@@ -190,7 +190,7 @@ void MapgenV6Params::readParams(const Settings *settings)
void MapgenV6Params::writeParams(Settings *settings) const
{
- settings->setFlagStr("mgv6_spflags", spflags, flagdesc_mapgen_v6, U32_MAX);
+ settings->setFlagStr("mgv6_spflags", spflags, flagdesc_mapgen_v6);
settings->setFloat("mgv6_freq_desert", freq_desert);
settings->setFloat("mgv6_freq_beach", freq_beach);
settings->setS16("mgv6_dungeon_ymin", dungeon_ymin);
@@ -210,8 +210,16 @@ void MapgenV6Params::writeParams(Settings *settings) const
}
+void MapgenV6Params::setDefaultSettings(Settings *settings)
+{
+ settings->setDefault("mgv6_spflags", flagdesc_mapgen_v6, MGV6_JUNGLES |
+ MGV6_SNOWBIOMES | MGV6_TREES | MGV6_BIOMEBLEND | MGV6_MUDFLOW);
+}
+
+
//////////////////////// Some helper functions for the map generator
+
// Returns Y one under area minimum if not found
s16 MapgenV6::find_stone_level(v2s16 p2d)
{