aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen_v5.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_v5.cpp
parent9cb3219f34be983e1b84a62a64c25e137d587365 (diff)
downloadhax-minetest-server-cde2a7f6f24f638421238ead4e61b155322fefc8.tar.gz
hax-minetest-server-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_v5.cpp')
-rw-r--r--src/mapgen/mapgen_v5.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mapgen/mapgen_v5.cpp b/src/mapgen/mapgen_v5.cpp
index c003c27d6..447fe8c50 100644
--- a/src/mapgen/mapgen_v5.cpp
+++ b/src/mapgen/mapgen_v5.cpp
@@ -129,7 +129,7 @@ void MapgenV5Params::readParams(const Settings *settings)
void MapgenV5Params::writeParams(Settings *settings) const
{
- settings->setFlagStr("mgv5_spflags", spflags, flagdesc_mapgen_v5, U32_MAX);
+ settings->setFlagStr("mgv5_spflags", spflags, flagdesc_mapgen_v5);
settings->setFloat("mgv5_cave_width", cave_width);
settings->setS16("mgv5_large_cave_depth", large_cave_depth);
settings->setU16("mgv5_small_cave_num_min", small_cave_num_min);
@@ -154,6 +154,15 @@ void MapgenV5Params::writeParams(Settings *settings) const
}
+void MapgenV5Params::setDefaultSettings(Settings *settings)
+{
+ settings->setDefault("mgv5_spflags", flagdesc_mapgen_v5, MGV5_CAVERNS);
+}
+
+
+/////////////////////////////////////////////////////////////////
+
+
int MapgenV5::getSpawnLevelAtPoint(v2s16 p)
{