Fix running core.step when receiving an event while not waiting

When `time_to_wake` was <= 0, so when a coroutine needed to be executed 
as soon as possible, we didn't check for events, so we only performed a 
`core.step` with the blink timer.
This resulted in jerky reactions to input.
This commit is contained in:
Guldoman
2023-11-29 09:41:55 +08:00
committed by takase1121
parent 3bf3266ca5
commit 6cd1f96234
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1411,7 +1411,7 @@ function core.run()
local cursor_time_to_wake = dt + 1 / config.fps
next_step = now + cursor_time_to_wake
end
if time_to_wake > 0 and system.wait_event(math.min(next_step - now, time_to_wake)) then
if system.wait_event(math.min(next_step - now, time_to_wake)) then
next_step = nil -- if we've recevied an event, perform a step
end
else