mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Settings: Fail on invalid sequence and throw exception for LuaSettings
This commit is contained in:
parent
b0c4fd6d3f
commit
d3dc88fe6b
4 changed files with 89 additions and 53 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue