diff options
| author | mat <git@matdoes.dev> | 2023-11-18 20:44:49 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-11-18 20:44:49 -0600 |
| commit | f0b58c7e748e1e94ad0dd08124cfc186e865709c (patch) | |
| tree | e57770be77d78262f89cc146179122a0b849c6c2 /azalea/src | |
| parent | 000abfa13665abccf543b875d10c8c2a48dd75be (diff) | |
| download | azalea-drasl-f0b58c7e748e1e94ad0dd08124cfc186e865709c.tar.xz | |
share registries in swarms and fix some bugs
Diffstat (limited to 'azalea/src')
| -rw-r--r-- | azalea/src/swarm/mod.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 05aabe68..0a263f39 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -394,9 +394,7 @@ where let first_bot_state = first_bot.component::<S>(); let first_bot_entity = first_bot.entity; - let mut tasks = Vec::new(); - - tasks.push((handler)(first_bot, first_event, first_bot_state.clone())); + tokio::spawn((handler)(first_bot, first_event, first_bot_state.clone())); // this makes it not have to keep locking the ecs let mut states = HashMap::new(); @@ -405,10 +403,8 @@ where let state = states .entry(bot.entity) .or_insert_with(|| bot.component::<S>().clone()); - tasks.push((handler)(bot, event, state.clone())); + tokio::spawn((handler)(bot, event, state.clone())); } - - tokio::spawn(join_all(tasks)); } } |
