mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user