From 9275cfc93869c47bfa5c99776f18e68a00789bd5 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Wed, 20 Apr 2022 20:45:09 +0200 Subject: fix mai trin success detection for early failures --- src/analyzers/strikes.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/analyzers') diff --git a/src/analyzers/strikes.rs b/src/analyzers/strikes.rs index 420a674..bc994e4 100644 --- a/src/analyzers/strikes.rs +++ b/src/analyzers/strikes.rs @@ -86,7 +86,12 @@ impl<'log> Analyzer for CaptainMaiTrin<'log> { let scarlet = self.log.characters().find(|npc| { npc.id() == Self::ECHO_OF_SCARLET_BRIAR || npc.id() == Self::ECHO_OF_SCARLET_BRIAR_CM - })?; + }); + // If the log ends before Scarlet even spawns, then it for sure is a failure. + let scarlet = match scarlet { + Some(s) => s, + None => return Some(Outcome::Failure), + }; let mai = self .log .characters() -- cgit v1.2.3