diff options
-rw-r--r-- | src/lua/embed/boot.lua.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lua/embed/boot.lua.h b/src/lua/embed/boot.lua.h index e0c43ee..fc201d1 100644 --- a/src/lua/embed/boot.lua.h +++ b/src/lua/embed/boot.lua.h @@ -37,6 +37,7 @@ function jin.core.run() local previous = jin.time.second() local SEC_PER_UPDATE = 1 / conf.fps local dt = SEC_PER_UPDATE + local running = true while(jin.core.running()) do for _, e in pairs(jin.event.poll()) do if e.type == "keydown" then @@ -45,10 +46,10 @@ function jin.core.run() jin.keyboard.set(e.key, false) end safecall(jin.core.onEvent, e) + running = jin.core.running() + if not running then break end end - if not jin.core.running() then - break - end + if not running then break end safecall(jin.core.onUpdate, dt) |