Release 1.4.11

- Fixed stack overflow in copyTable()
- Fixed interaction between weapon swap and skilsl granted by items
- Consolidated list controls using a new base class
This commit is contained in:
Openarl
2017-05-16 19:05:02 +10:00
parent 8a1c666b2d
commit eb91bcbf66
28 changed files with 1282 additions and 1840 deletions

View File

@@ -145,16 +145,25 @@ function isMouseInRegion(region)
end
-- Make a copy of a table and all subtables
function copyTable(tbl, noRecurse)
local out = {}
for k, v in pairs(tbl) do
if not noRecurse and type(v) == "table" then
out[k] = copyTable(v)
else
out[k] = v
do
local subTableMap = { }
function copyTable(tbl, noRecurse, isSubTable)
local out = {}
if not noRecurse then
subTableMap[tbl] = out
end
for k, v in pairs(tbl) do
if not noRecurse and type(v) == "table" then
out[k] = subTableMap[v] or copyTable(v, false, true)
else
out[k] = v
end
end
if not noRecurse and not isSubTable then
wipeTable(subTableMap)
end
return out
end
return out
end
-- Wipe all keys from the table and return it, or return a new table if no table provided