1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Modernize code: very last fixes (#6290)

Last modernization fixes
This commit is contained in:
Loïc Blot 2017-08-20 19:37:29 +02:00 committed by GitHub
parent c8d3d11339
commit ae9b5e0098
31 changed files with 428 additions and 523 deletions

View file

@ -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);