aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-12 00:44:17 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-12 00:44:17 -0500
commitd3dc88fe6bae0371c3e314cfc6db4ca8a06a4ab6 (patch)
tree58d1096e81c9b7dd01a7b3fc7f3583ea85194ab7 /src/script
parentb0c4fd6d3f1c8e44896358ee9b0af20e9b304944 (diff)
downloadminetest-d3dc88fe6bae0371c3e314cfc6db4ca8a06a4ab6.tar.gz
minetest-d3dc88fe6bae0371c3e314cfc6db4ca8a06a4ab6.tar.bz2
minetest-d3dc88fe6bae0371c3e314cfc6db4ca8a06a4ab6.zip
Settings: Fail on invalid sequence and throw exception for LuaSettings
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_settings.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/lua_api/l_settings.cpp b/src/script/lua_api/l_settings.cpp
index 13a88ee95..9c88a3e05 100644
--- a/src/script/lua_api/l_settings.cpp
+++ b/src/script/lua_api/l_settings.cpp
@@ -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