mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Settings: Fail on invalid sequence and throw exception for LuaSettings
This commit is contained in:
@@ -73,9 +73,10 @@ int LuaSettings::l_set(lua_State* L)
|
||||
std::string key = std::string(luaL_checkstring(L, 2));
|
||||
const char* value = luaL_checkstring(L, 3);
|
||||
|
||||
o->m_settings->set(key, value);
|
||||
if (!o->m_settings->set(key, value))
|
||||
throw LuaError("Invalid sequence found in setting parameters");
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// remove(self, key) -> success
|
||||
|
Reference in New Issue
Block a user