mirror of
https://github.com/appgurueu/modlib.git
synced 2024-08-20 21:34:10 +02:00
Fix Lua log file reference handling if only :load() and not :init() is called
This commit is contained in:
parent
2d8c77b7dd
commit
407a2d55ed
@ -44,7 +44,15 @@ function lua_log_file:load()
|
|||||||
setfenv(read, env)
|
setfenv(read, env)
|
||||||
read()
|
read()
|
||||||
env.R = env.R or {{}}
|
env.R = env.R or {{}}
|
||||||
self.reference_count = #env.R
|
local reference_count = #env.R
|
||||||
|
for ref in pairs(env.R) do
|
||||||
|
if ref > reference_count then
|
||||||
|
-- Ensure reference count always has the value of the largest reference
|
||||||
|
-- in case of "holes" (nil values) in the reference list
|
||||||
|
reference_count = ref
|
||||||
|
end
|
||||||
|
end
|
||||||
|
self.reference_count = reference_count
|
||||||
self.root = env.R[1]
|
self.root = env.R[1]
|
||||||
set_references(self, {})
|
set_references(self, {})
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user