mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
Always set globals in __newindex (#13131)
This commit is contained in:
parent
d0b6f217ae
commit
d69cb4fb5d
@ -14,6 +14,7 @@ local declared = {}
|
|||||||
local warned = {}
|
local warned = {}
|
||||||
|
|
||||||
function meta:__newindex(name, value)
|
function meta:__newindex(name, value)
|
||||||
|
rawset(self, name, value)
|
||||||
if declared[name] then
|
if declared[name] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -25,7 +26,6 @@ function meta:__newindex(name, value)
|
|||||||
:format(name, desc))
|
:format(name, desc))
|
||||||
warned[warn_key] = true
|
warned[warn_key] = true
|
||||||
end
|
end
|
||||||
rawset(self, name, value)
|
|
||||||
declared[name] = true
|
declared[name] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user