mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix crash on passing false as value in table to table.copy(t)
Fixes #2293.
This commit is contained in:
parent
e62927ed71
commit
61588a43dd
1 changed files with 2 additions and 3 deletions
|
@ -545,12 +545,11 @@ function table.copy(t, seen)
|
||||||
seen = seen or {}
|
seen = seen or {}
|
||||||
seen[t] = n
|
seen[t] = n
|
||||||
for k, v in pairs(t) do
|
for k, v in pairs(t) do
|
||||||
n[type(k) ~= "table" and k or seen[k] or table.copy(k, seen)] =
|
n[(type(k) == "table" and (seen[k] or table.copy(k, seen))) or k] =
|
||||||
type(v) ~= "table" and v or seen[v] or table.copy(v, seen)
|
(type(v) == "table" and (seen[v] or table.copy(v, seen))) or v
|
||||||
end
|
end
|
||||||
return n
|
return n
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- mainmenu only functions
|
-- mainmenu only functions
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue