diff options
| author | mat <git@matdoes.dev> | 2023-12-02 16:06:42 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-12-02 16:06:42 -0600 |
| commit | f052882123220bdfaeb827199394f920ea1cd43d (patch) | |
| tree | 734e243d10ac477c2b036247aeddd9478e3477e3 /azalea/src/lib.rs | |
| parent | 34a40270108e51014e0884c3b6b6619ba42c17dc (diff) | |
| download | azalea-drasl-f052882123220bdfaeb827199394f920ea1cd43d.tar.xz | |
make sure Startup system runs before any bots join
Diffstat (limited to 'azalea/src/lib.rs')
| -rw-r--r-- | azalea/src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index bf00cbbe..8f86f97f 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -193,9 +193,18 @@ where // An event that causes the schedule to run. This is only used internally. let (run_schedule_sender, run_schedule_receiver) = mpsc::unbounded_channel(); + let main_schedule_label = self.app.main_schedule_label; + let ecs_lock = start_ecs_runner(self.app, run_schedule_receiver, run_schedule_sender.clone()); + // run the main schedule so the startup systems run + { + let mut ecs = ecs_lock.lock(); + ecs.run_schedule(main_schedule_label); + ecs.clear_trackers(); + } + let (bot, mut rx) = Client::start_client( ecs_lock, &account, |
