From ae23564709fb38381894712671dd1dea100e3b73 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Wed, 3 Jan 2024 09:53:53 -0600 Subject: [PATCH] Update set_timer patch --- platform_wasm/pygame/timer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform_wasm/pygame/timer.py b/platform_wasm/pygame/timer.py index af6fd29..e096a37 100644 --- a/platform_wasm/pygame/timer.py +++ b/platform_wasm/pygame/timer.py @@ -81,7 +81,12 @@ async def fire_event(thread_uuid): loop_counter = 0 while True: await asyncio.sleep(dlay) - if event_loop.is_closed() or event not in THREADS or THREADS[event] != thread_uuid or (loops and loop_counter >= loops): + if ( + event_loop.is_closed() + or event not in THREADS + or THREADS[event] != thread_uuid + or (loops and loop_counter >= loops) + ): break pygame.event.post(cevent)