aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mapgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api/l_mapgen.cpp')
-rw-r--r--src/script/lua_api/l_mapgen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp
index a5e122ddb..0875e2c95 100644
--- a/src/script/lua_api/l_mapgen.cpp
+++ b/src/script/lua_api/l_mapgen.cpp
@@ -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);