aboutsummaryrefslogtreecommitdiff
path: root/azalea/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/src')
-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();