From d995cdefcb01b002860afbd67edb0cff1847aaed Mon Sep 17 00:00:00 2001 From: Wires77 Date: Wed, 5 Nov 2025 22:06:50 -0600 Subject: [PATCH] Add coroutine wrapper for tracking active coroutines --- src/Modules/Common.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Modules/Common.lua b/src/Modules/Common.lua index 3132480edd..3d19d4c799 100644 --- a/src/Modules/Common.lua +++ b/src/Modules/Common.lua @@ -42,6 +42,19 @@ if launch.devMode and profiler == nil then ConPrintf("Unable to Load Profiler") end +-- Optimize coroutines to run at full framerate +local co_create = coroutine.create +local active_coroutines = setmetatable({}, { __mode = "k" }) +function coroutine.create(func) + local co = co_create(func) + active_coroutines[co] = true + return co +end + +function coroutine._list() + return active_coroutines +end + -- Class library common.classes = { } local function addSuperParents(class, parent)