diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_settings.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/script/lua_api/l_settings.cpp b/src/script/lua_api/l_settings.cpp index 141ac61d1..1d56aed5f 100644 --- a/src/script/lua_api/l_settings.cpp +++ b/src/script/lua_api/l_settings.cpp @@ -100,7 +100,11 @@ int LuaSettings::l_get_bool(lua_State* L) bool value = o->m_settings->getBool(key); lua_pushboolean(L, value); } else { - lua_pushnil(L); + // Push default value + if (lua_isboolean(L, 3)) + lua_pushboolean(L, lua_toboolean(L, 3)); + else + lua_pushnil(L); } return 1; |