mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-26 02:10:18 +01:00
Luacontroller: Fix bugs in 703e6fda
, no more functions as keys
Thanks to @ShadowNinja for reporting this Make sure functions that are keys in tables and functions inside nested tables also get removed when using digiline_send.
This commit is contained in:
parent
703e6fdadb
commit
8743699298
@ -157,12 +157,14 @@ function mesecon.tablecopy_stripfunctions(table) -- deep table copy, but remove
|
|||||||
local newtable = {}
|
local newtable = {}
|
||||||
|
|
||||||
for idx, item in pairs(table) do
|
for idx, item in pairs(table) do
|
||||||
|
if type(idx) ~= "function" then
|
||||||
if type(item) == "table" then
|
if type(item) == "table" then
|
||||||
newtable[idx] = mesecon.tablecopy(item)
|
newtable[idx] = mesecon.tablecopy_stripfunctions(item)
|
||||||
elseif type(item) ~= "function" then
|
elseif type(item) ~= "function" then
|
||||||
newtable[idx] = item
|
newtable[idx] = item
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return newtable
|
return newtable
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user