1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-10 11:25:07 -05:00

Fix crash on passing false as value in table to table.copy(t)

Fixes #2293.
This commit is contained in:
est31 2015-02-12 22:03:24 +01:00 committed by Craig Robbins
parent e62927ed71
commit 61588a43dd

View File

@ -545,12 +545,11 @@ function table.copy(t, seen)
seen = seen or {}
seen[t] = n
for k, v in pairs(t) do
n[type(k) ~= "table" and k or seen[k] or table.copy(k, seen)] =
type(v) ~= "table" and v or seen[v] or table.copy(v, seen)
n[(type(k) == "table" and (seen[k] or table.copy(k, seen))) or k] =
(type(v) == "table" and (seen[v] or table.copy(v, seen))) or v
end
return n
end
--------------------------------------------------------------------------------
-- mainmenu only functions
--------------------------------------------------------------------------------