diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2020-01-25 16:56:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-25 16:56:54 +0100 |
commit | cde2a7f6f24f638421238ead4e61b155322fefc8 (patch) | |
tree | 96b6b1dd00a0c14660eea6f3f518b5d832dc1bd8 /src/mapgen/mapgen_flat.cpp | |
parent | 9cb3219f34be983e1b84a62a64c25e137d587365 (diff) | |
download | hax-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 '')
-rw-r--r-- | src/mapgen/mapgen_flat.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mapgen/mapgen_flat.cpp b/src/mapgen/mapgen_flat.cpp index 656e7d72c..879435948 100644 --- a/src/mapgen/mapgen_flat.cpp +++ b/src/mapgen/mapgen_flat.cpp @@ -126,7 +126,7 @@ void MapgenFlatParams::readParams(const Settings *settings) void MapgenFlatParams::writeParams(Settings *settings) const { - settings->setFlagStr("mgflat_spflags", spflags, flagdesc_mapgen_flat, U32_MAX); + settings->setFlagStr("mgflat_spflags", spflags, flagdesc_mapgen_flat); settings->setS16("mgflat_ground_level", ground_level); settings->setS16("mgflat_large_cave_depth", large_cave_depth); settings->setU16("mgflat_small_cave_num_min", small_cave_num_min); @@ -150,6 +150,12 @@ void MapgenFlatParams::writeParams(Settings *settings) const } +void MapgenFlatParams::setDefaultSettings(Settings *settings) +{ + settings->setDefault("mgflat_spflags", flagdesc_mapgen_flat, 0); +} + + ///////////////////////////////////////////////////////////////// |