aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.h
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.h
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.h')
-rw-r--r--src/mapgen/mapgen.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mapgen/mapgen.h b/src/mapgen/mapgen.h
index 1473d41a6..dc325c791 100644
--- a/src/mapgen/mapgen.h
+++ b/src/mapgen/mapgen.h
@@ -124,7 +124,9 @@ struct MapgenParams {
u64 seed = 0;
s16 water_level = 1;
s16 mapgen_limit = MAX_MAP_GENERATION_LIMIT;
- u32 flags = MG_CAVES | MG_LIGHT | MG_DECORATIONS | MG_BIOMES;
+ // Flags set in readParams
+ u32 flags = 0;
+ u32 spflags = 0;
BiomeParams *bparams = nullptr;
@@ -133,6 +135,8 @@ struct MapgenParams {
virtual void readParams(const Settings *settings);
virtual void writeParams(Settings *settings) const;
+ // Default settings for g_settings such as flags
+ virtual void setDefaultSettings(Settings *settings) {};
s32 getSpawnRangeMax();
@@ -214,6 +218,7 @@ public:
EmergeManager *emerge);
static MapgenParams *createMapgenParams(MapgenType mgtype);
static void getMapgenNames(std::vector<const char *> *mgnames, bool include_hidden);
+ static void setDefaultSettings(Settings *settings);
private:
// isLiquidHorizontallyFlowable() is a helper function for updateLiquid()