From adef9bf37b854b65b9df3cb3071d215daf6bd454 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 24 Apr 2025 20:55:58 -0330 Subject: always insert Swarm before any systems can start running --- azalea/src/swarm/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'azalea/src') diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 6ecf4d32..9be5d7ea 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -396,7 +396,7 @@ where let main_schedule_label = self.app.main().update_schedule.unwrap(); - let ecs_lock = start_ecs_runner(self.app); + let (ecs_lock, start_running_systems) = start_ecs_runner(self.app); let swarm = Swarm { ecs_lock: ecs_lock.clone(), @@ -420,6 +420,10 @@ where ecs.clear_trackers(); } + // only do this after we inserted the Swarm and state resources to avoid errors + // where Res is inaccessible + start_running_systems(); + // SwarmBuilder (self) isn't Send so we have to take all the things we need out // of it let swarm_clone = swarm.clone(); -- cgit v1.2.3