]> git.lizzy.rs Git - minetest.git/blobdiff - builtin/common/strict.lua
Always set globals in __newindex (#13131)
[minetest.git] / builtin / common / strict.lua
index 6a385fa803fb2eaa10a8eb7353b2c8941c893e96..9bfa8d7a2105d70fe6ab91dde23094c021d76065 100644 (file)
@@ -14,6 +14,7 @@ local declared = {}
 local warned = {}
 
 function meta:__newindex(name, value)
+       rawset(self, name, value)
        if declared[name] then
                return
        end
@@ -25,7 +26,6 @@ function meta:__newindex(name, value)
                                :format(name, desc))
                warned[warn_key] = true
        end
-       rawset(self, name, value)
        declared[name] = true
 end