From 4f874af2565a10a5e9b7485982674e7d5d5243ad Mon Sep 17 00:00:00 2001 From: templeofshadow Date: Thu, 25 Jun 2026 15:34:43 -0500 Subject: [PATCH] fix attempt 1 of the terminate check stopping the mainloop --- main.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 43fec52..546bb18 100644 --- a/main.lua +++ b/main.lua @@ -775,7 +775,12 @@ function Main() -- Add a small delay to avoid overloading the system os.sleep(0.1) - local event = os.pullEventRaw("terminate") + local event = nil + local function getTerminateEvent() + event = os.pullEventRaw("terminate") + end + + parallel.waitForAny(os.sleep(0.1), getTerminateEvent) if event == "terminate" then print("Terminate Event Received") break end end