Fixed wrapper bug when doing manual lurker.scan()

This commit is contained in:
rxi
2014-03-09 01:40:05 +00:00
parent 2d13a73fa5
commit 709ce34a8d

View File

@@ -128,17 +128,25 @@ function lurker.onerror(e)
end end
function lurker.onfirstframe() function lurker.exitinitstate()
lurker.state = "normal"
if lurker.protected then if lurker.protected then
lurker.initwrappers() lurker.initwrappers()
end end
end end
function lurker.exiterrorstate()
lurker.state = "normal"
for _, v in pairs(lovecallbacknames) do
love[v] = lurker.funcwrappers[v]
end
end
function lurker.update() function lurker.update()
if lurker.state == "init" then if lurker.state == "init" then
lurker.onfirstframe() lurker.exitinitstate()
lurker.state = "normal"
end end
local diff = time() - lurker.last local diff = time() - lurker.last
if diff > lurker.interval then if diff > lurker.interval then
@@ -166,14 +174,6 @@ function lurker.resetfile(f)
end end
function lurker.exiterrorstate()
lurker.state = "normal"
for _, v in pairs(lovecallbacknames) do
love[v] = lurker.funcwrappers[v]
end
end
function lurker.hotswapfile(f) function lurker.hotswapfile(f)
lurker.print("Hotswapping '{1}'...", {f}) lurker.print("Hotswapping '{1}'...", {f})
if lurker.state == "error" then if lurker.state == "error" then
@@ -196,6 +196,9 @@ end
function lurker.scan() function lurker.scan()
if lurker.state == "init" then
lurker.exitinitstate()
end
lume.each(lurker.getchanged(), lurker.hotswapfile) lume.each(lurker.getchanged(), lurker.hotswapfile)
end end