mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-29 18:53:44 +01:00
Persistence: Fix Lua log file table dump
This commit is contained in:
parent
8dc3054dd0
commit
29ed334369
@ -103,8 +103,9 @@ function lua_log_file:_dump(value, is_key)
|
|||||||
for _, value in ipairs(value) do
|
for _, value in ipairs(value) do
|
||||||
table.insert(entries, self:_dump(value))
|
table.insert(entries, self:_dump(value))
|
||||||
end
|
end
|
||||||
|
local tablelen = #value
|
||||||
for key, value in pairs(value) do
|
for key, value in pairs(value) do
|
||||||
if type(key) ~= "number" or key % 1 ~= 0 or key < 1 or key > #value then
|
if type(key) ~= "number" or key % 1 ~= 0 or key < 1 or key > tablelen then
|
||||||
local dumped, short = self:_dump(key, true)
|
local dumped, short = self:_dump(key, true)
|
||||||
table.insert(entries, (short and dumped or ("[" .. dumped .. "]")) .. "=" .. self:_dump(value))
|
table.insert(entries, (short and dumped or ("[" .. dumped .. "]")) .. "=" .. self:_dump(value))
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user