mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Warn if metatable passed to itemdef registration function
This commit is contained in:
parent
4125ce877d
commit
2540667f04
3 changed files with 12 additions and 6 deletions
|
@ -9,8 +9,8 @@ do
|
|||
all.registered_craftitems = {}
|
||||
all.registered_tools = {}
|
||||
for k, v in pairs(all.registered_items) do
|
||||
-- Disable further modification
|
||||
setmetatable(v, {__newindex = {}})
|
||||
-- Ignore new keys
|
||||
setmetatable(v, {__newindex = function() end})
|
||||
-- Reassemble the other tables
|
||||
if v.type == "node" then
|
||||
getmetatable(v).__index = all.nodedef_default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue