From 24df15dbbb4967a96c6b3be4376f64be6126b686 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 15 Sep 2020 15:06:55 +0200 Subject: fix logs with Claw of the Fallen ID --- src/gamedata.rs | 11 +++++++++++ src/lib.rs | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/gamedata.rs b/src/gamedata.rs index 5e83167..775cf30 100644 --- a/src/gamedata.rs +++ b/src/gamedata.rs @@ -63,6 +63,12 @@ pub enum Boss { // Strike missions IcebroodConstruct = 0x568A, + /// This is the ID of the Voice of the Fallen. + /// + /// The strike mission itself contains two bosses, the Voice of the Fallen and the Claw of the + /// Fallen. Consider using either [`VOICE_OF_THE_FALLEN_ID`][VOICE_OF_THE_FALLEN_ID] or + /// [`CLAW_OF_THE_FALLEN_ID`][CLAW_OF_THE_FALLEN_ID] if you refer to one of those bosses + /// specifically. VoiceOfTheFallen = 0x5747, FraenirOfJormag = 0x57DC, Boneskinner = 0x57F9, @@ -176,6 +182,11 @@ pub const NIKARE_ID: u16 = Boss::LargosTwins as u16; /// The ID of Kenut in the Twin Largos fight. pub const KENUT_ID: u16 = 21089; +/// The ID of the Voice of the Fallen. +pub const VOICE_OF_THE_FALLEN_ID: u16 = Boss::VoiceOfTheFallen as u16; +/// The ID of the Claw of the Fallen. +pub const CLAW_OF_THE_FALLEN_ID: u16 = 22481; + /// Error for when converting a string to a profession fails. #[derive(Debug, Clone, PartialEq, Eq, Hash, Error)] #[error("Invalid profession identifier: {0}")] diff --git a/src/lib.rs b/src/lib.rs index c9f1ec1..babfc34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -762,6 +762,11 @@ impl Log { vec![self.boss_id, gamedata::XERA_PHASE2_ID] } else if self.boss_id == Boss::LargosTwins as u16 { vec![gamedata::NIKARE_ID, gamedata::KENUT_ID] + } else if self.encounter() == Some(Boss::VoiceOfTheFallen) { + vec![ + gamedata::VOICE_OF_THE_FALLEN_ID, + gamedata::CLAW_OF_THE_FALLEN_ID, + ] } else { vec![self.boss_id] }; @@ -789,6 +794,12 @@ impl Log { /// if we know about it in [`Boss`][Boss]. #[inline] pub fn encounter(&self) -> Option { + // Sometimes, encounters of the strike mission "Voice of the Fallen and Claw of the Fallen" + // are saved with the ID of the Claw and sometimes with the Voice. Therefore, we need to + // unify those cases. + if self.boss_id == gamedata::CLAW_OF_THE_FALLEN_ID { + return Some(Boss::VoiceOfTheFallen); + } Boss::from_u16(self.boss_id) } -- cgit v1.2.3