aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/swarm
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/src/swarm')
-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 66e5ea23..18c92438 100644
--- a/azalea/src/swarm/mod.rs
+++ b/azalea/src/swarm/mod.rs
@@ -390,7 +390,11 @@ where
while let Some((Some(event), bot)) = bots_rx.recv().await {
if let Some(handler) = &self.handler {
let state = bot.component::<S>();
- tokio::spawn((handler)(bot, event, state));
+ tokio::spawn((handler)(bot, event, state.clone()));
+ // this makes it not have to keep locking the ecs
+ while let Ok((Some(event), bot)) = bots_rx.try_recv() {
+ tokio::spawn((handler)(bot, event, state.clone()));
+ }
}
}