diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-08-20 19:37:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-20 19:37:29 +0200 |
commit | ae9b5e00989756bb676429530dfe81039009001c (patch) | |
tree | 119c9ac4b886c24d42f418e21e4175a942eb95ff /src/script | |
parent | c8d3d1133945138108aa195e6b3c93b07c6e4fa0 (diff) | |
download | minetest-ae9b5e00989756bb676429530dfe81039009001c.tar.gz minetest-ae9b5e00989756bb676429530dfe81039009001c.tar.bz2 minetest-ae9b5e00989756bb676429530dfe81039009001c.zip |
Modernize code: very last fixes (#6290)
Last modernization fixes
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 6 |
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); |