From c435f69a2362dd828df70dbddd1fcad83e8a9e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Sejkora?= Date: Tue, 22 Aug 2023 07:55:35 +0200 Subject: [PATCH] Analytics: Fix processing failing if Emboldened is applied midfight --- .../Encounters/Modes/EmboldenedDetectingModeDeterminer.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/EVTCAnalytics/Processing/Encounters/Modes/EmboldenedDetectingModeDeterminer.cs b/EVTCAnalytics/Processing/Encounters/Modes/EmboldenedDetectingModeDeterminer.cs index b3be3c4b..4c757733 100644 --- a/EVTCAnalytics/Processing/Encounters/Modes/EmboldenedDetectingModeDeterminer.cs +++ b/EVTCAnalytics/Processing/Encounters/Modes/EmboldenedDetectingModeDeterminer.cs @@ -35,7 +35,13 @@ public class EmboldenedDetectingModeDeterminer : IModeDeterminer } } - var maxEmboldenedCount = emboldenedCounts.Values.Max(); + // In case Emboldened appears only due to buff applications, we currently default to 0. + // Note that this can be both correct and wrong, depending on when this happens: + // - at the end of the fight, the log can capture the emboldened buff being applied (if coming from CM fight) / reset, we want to ignore this + // - in the middle of a fight, this can be legitimate when the emboldened wing changes to the one the fight is happening in, we want to count this + // TODO: fix this ^ + + var maxEmboldenedCount = emboldenedCounts.Values.DefaultIfEmpty(0).Max(); var mode = maxEmboldenedCount switch { <= 0 => EncounterMode.Normal, 1 => EncounterMode.Emboldened1,