diff --git a/crates/sapphire-jecs/lib/init.luau b/crates/sapphire-jecs/lib/init.luau index 7d86c7e..c4f979c 100644 --- a/crates/sapphire-jecs/lib/init.luau +++ b/crates/sapphire-jecs/lib/init.luau @@ -115,7 +115,14 @@ function SapphireJecs.extension() registered_phases["heartbeat"] = cheartbeat local function runner(event: event): (...any) -> () + local current_sys: (...any) -> () = nil + local current_args: {} = nil + local function call_system() + current_sys(unpack(current_args)) + end + return function(...) + current_args = table.pack(...) for _, system in runnables[event] do local id = system.id local system_data = jabby_scheduler.system_data[id] @@ -123,8 +130,12 @@ function SapphireJecs.extension() continue end + current_sys = system.run + jabby_scheduler:_mark_system_frame_start(id) - system.run(...) + for _ in call_system :: any do + break + end jabby_scheduler:_mark_system_frame_end(id) end end diff --git a/crates/sapphire-jecs/wally.toml b/crates/sapphire-jecs/wally.toml index 8aad2ee..2672fae 100644 --- a/crates/sapphire-jecs/wally.toml +++ b/crates/sapphire-jecs/wally.toml @@ -1,6 +1,6 @@ [package] name = "mark-marks/sapphire-jecs" -version = "0.2.0-rc.1" +version = "0.2.0-rc.2" registry = "https://github.com/UpliftGames/wally-index" realm = "shared" license = "MIT"