Fix main menu being unable to set secure settings
authorShadowNinja <shadowninja@minetest.net>
Thu, 3 Mar 2016 05:57:19 +0000 (00:57 -0500)
committerShadowNinja <shadowninja@minetest.net>
Thu, 3 Mar 2016 05:57:19 +0000 (00:57 -0500)
src/script/lua_api/l_util.cpp

index cc4467bb61bec5bc27d570c411947434b92b343e..df46925d184e2b08fd33bf1c0a90388b304f5819 100644 (file)
@@ -75,9 +75,10 @@ int ModApiUtil::l_get_us_time(lua_State *L)
 }
 
 #define CHECK_SECURE_SETTING(L, name) \
-       if (name.compare(0, 7, "secure.") == 0) {\
-               lua_pushliteral(L, "Attempt to set secure setting.");\
-               lua_error(L);\
+       if (ScriptApiSecurity::isSecure(L) && \
+                       name.compare(0, 7, "secure.") == 0) { \
+               lua_pushliteral(L, "Attempt to set secure setting."); \
+               lua_error(L); \
        }
 
 // setting_set(name, value)