mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
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>
This commit is contained in:
parent
9cb3219f34
commit
cde2a7f6f2
23 changed files with 222 additions and 39 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue