aboutsummaryrefslogtreecommitdiff
path: root/azalea
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-24 20:55:58 -0330
committermat <git@matdoes.dev>2025-04-24 20:55:58 -0330
commitadef9bf37b854b65b9df3cb3071d215daf6bd454 (patch)
treec081448a5b5952ded71c23da4e8063f663fe6937 /azalea
parent89bc5ca91ebfe585c8df8891d94856068c7ad2be (diff)
downloadazalea-drasl-adef9bf37b854b65b9df3cb3071d215daf6bd454.tar.xz
always insert Swarm before any systems can start running
Diffstat (limited to 'azalea')
-rw-r--r--azalea/src/swarm/mod.rs6
1 files changed, 5 insertions, 1 deletions
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<Swarm> 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();