diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-09-23 21:34:57 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-09-23 21:34:57 +0200 |
commit | a1d81ac774c0ae52f155cd764fd74fd1ba928a5f (patch) | |
tree | f0d4c7fda3f09fcc824795100b045d456baeecec /planetwars-matchrunner/src/lib.rs | |
parent | 8f3621813e44df2dace49a6400cfe870bc3778ea (diff) | |
download | planetwars.dev-a1d81ac774c0ae52f155cd764fd74fd1ba928a5f.tar.xz planetwars.dev-a1d81ac774c0ae52f155cd764fd74fd1ba928a5f.zip |
ensure bots cleanly stop before a match completes
Diffstat (limited to 'planetwars-matchrunner/src/lib.rs')
-rw-r--r-- | planetwars-matchrunner/src/lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/planetwars-matchrunner/src/lib.rs b/planetwars-matchrunner/src/lib.rs index d26e810..50cff70 100644 --- a/planetwars-matchrunner/src/lib.rs +++ b/planetwars-matchrunner/src/lib.rs @@ -106,11 +106,9 @@ pub async fn run_match(config: MatchConfig) -> MatchOutcome { // ) // .unwrap(); - let mut match_state = pw_match::PwMatch::create(match_ctx, pw_config); - match_state.run().await; + let final_state = pw_match::PwMatch::create(match_ctx, pw_config).run().await; - let final_state = match_state.match_state.state(); - let survivors = final_state.living_players(); + let survivors = final_state.state().living_players(); let winner = if survivors.len() == 1 { Some(survivors[0]) } else { |