mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
parent
c8d3d11339
commit
ae9b5e0098
31 changed files with 428 additions and 523 deletions
|
@ -731,7 +731,7 @@ int ModApiMapgen::l_set_mapgen_setting(lua_State *L)
|
|||
|
||||
const char *name = luaL_checkstring(L, 1);
|
||||
const char *value = luaL_checkstring(L, 2);
|
||||
bool override_meta = lua_isboolean(L, 3) ? lua_toboolean(L, 3) : false;
|
||||
bool override_meta = lua_isboolean(L, 3) && lua_toboolean(L, 3);
|
||||
|
||||
if (!settingsmgr->setMapSetting(name, value, override_meta)) {
|
||||
errorstream << "set_mapgen_setting: cannot set '"
|
||||
|
@ -760,7 +760,7 @@ int ModApiMapgen::l_set_mapgen_setting_noiseparams(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool override_meta = lua_isboolean(L, 3) ? lua_toboolean(L, 3) : false;
|
||||
bool override_meta = lua_isboolean(L, 3) && lua_toboolean(L, 3);
|
||||
|
||||
if (!settingsmgr->setMapSettingNoiseParams(name, &np, override_meta)) {
|
||||
errorstream << "set_mapgen_setting_noiseparams: cannot set '"
|
||||
|
@ -786,7 +786,7 @@ int ModApiMapgen::l_set_noiseparams(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool set_default = lua_isboolean(L, 3) ? lua_toboolean(L, 3) : true;
|
||||
bool set_default = !lua_isboolean(L, 3) || lua_toboolean(L, 3);
|
||||
|
||||
g_settings->setNoiseParams(name, np, set_default);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue