From 69da697e4f77504e4042da07f4f5c26b2e8a16f9 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Wed, 23 Sep 2020 14:53:38 +0200 Subject: use Log::is_boss instead of manually checking --- src/analyzers/fractals.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/analyzers/fractals.rs b/src/analyzers/fractals.rs index 85063bc..69b7f17 100644 --- a/src/analyzers/fractals.rs +++ b/src/analyzers/fractals.rs @@ -1,7 +1,7 @@ //! Analyzers for (challenge mote) fractal encounters. use crate::{ analyzers::{helpers, Analyzer, Outcome}, - Boss, EventKind, Log, + EventKind, Log, }; /// The ID of the invulnerability buff that Ai gets when she has been defeated. @@ -85,14 +85,8 @@ impl<'log> Analyzer for Ai<'log> { .. } = event.kind() { - let agent = self - .log - .agent_by_addr(*destination_agent_addr) - .and_then(|a| a.as_character()); - if let Some(c) = agent { - if c.id() == Boss::Ai as u16 && *buff_id == AI_INVULNERABILITY_ID { - return Some(Outcome::Success); - } + if *buff_id == AI_INVULNERABILITY_ID && self.log.is_boss(*destination_agent_addr) { + return Some(Outcome::Success); } } } -- cgit v1.2.3