From a1d81ac774c0ae52f155cd764fd74fd1ba928a5f Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Fri, 23 Sep 2022 21:34:57 +0200 Subject: ensure bots cleanly stop before a match completes --- planetwars-matchrunner/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'planetwars-matchrunner/src/lib.rs') 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 { -- cgit v1.2.3