Lua: Fix console pretty-print output not showing zero or negative keys in tables

This commit is contained in:
Celtic Minstrel 2021-08-08 15:11:02 -04:00 committed by Celtic Minstrel
parent add5476964
commit 4fbf33a0ca

View file

@ -50,7 +50,9 @@ function ilua.join(tbl,delim,limit,depth)
end
for key,v in pairs(tbl) do
if type(key) == 'number' then
if key <= n then goto continue end
if n > 0 and key > 0 and key <= n and math.type(key) == 'integer' then
goto continue
end
key = '['..tostring(key)..']'
else
key = tostring(key)