Skip to content

Commit

Permalink
Luacontroller: Fix bugs in 703e6fd, no more functions as keys
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Jeija committed Dec 31, 2016
1 parent 703e6fd commit 8743699
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mesecons/util.lua
Expand Up @@ -157,10 +157,12 @@ function mesecon.tablecopy_stripfunctions(table) -- deep table copy, but remove
local newtable = {}
for idx, item in pairs(table) do
if type(item) == "table" then
newtable[idx] = mesecon.tablecopy(item)
elseif type(item) ~= "function" then
newtable[idx] = item
if type(idx) ~= "function" then
if type(item) == "table" then
newtable[idx] = mesecon.tablecopy_stripfunctions(item)
elseif type(item) ~= "function" then
newtable[idx] = item
end
end
end
Expand Down

0 comments on commit 8743699

Please sign in to comment.