From cd7cf57152abf3371e1f4c690d5a736b4c28c7b2 Mon Sep 17 00:00:00 2001 From: Anonomit Date: Thu, 29 Sep 2022 16:12:24 -0400 Subject: [PATCH] Fix lua error with Chaotic gems --- Operations/ModifyTooltipData.lua | 4 ++-- Operations/RecognizeLineTypes.lua | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Operations/ModifyTooltipData.lua b/Operations/ModifyTooltipData.lua index f7a2b02..dc0a167 100644 --- a/Operations/ModifyTooltipData.lua +++ b/Operations/ModifyTooltipData.lua @@ -13,12 +13,12 @@ function Addon:ModifyTooltipData(tooltip, tooltipData) for i, line in ipairs(tooltipData) do self:RecognizeStat(line) + self:DebugfIf({"debugOutput", "lineRecognitions"}, "line: %d, textLeft: '%s', type: '%s', stat: '%s', prefix: '%s', colorLeft: '%s'", i, line.textLeftText, tostring(line.type), tostring(line.stat), tostring(line.prefix), line.colorLeft) + if not self:HideLine(line) then self:RecolorLine(tooltip, line, tooltipData) self:RewordLine(tooltip, line, tooltipData) end - - self:DebugfIf({"debugOutput", "lineRecognitions"}, "line: %d, textLeft: '%s', type: '%s', stat: '%s', prefix: '%s'", i, line.textLeftText, tostring(line.type), tostring(line.stat), tostring(line.prefix)) end self:ReorderLines(tooltipData) diff --git a/Operations/RecognizeLineTypes.lua b/Operations/RecognizeLineTypes.lua index 2745385..eb371b8 100644 --- a/Operations/RecognizeLineTypes.lua +++ b/Operations/RecognizeLineTypes.lua @@ -187,6 +187,7 @@ contextActions = Addon:Map({ Damage = function(i, tooltipData, line) if MatchesAny(line.textLeftTextStripped, DAMAGE_TEMPLATE, DAMAGE_TEMPLATE_WITH_SCHOOL, SINGLE_DAMAGE_TEMPLATE) then local speed = strMatch(line.textRightText or "", numberPattern) + if not speed then return end -- SINGLE_DAMAGE_TEMPLATE can match unrelated lines, like in Chaotic gems tooltipData.speedStringFull = line.textRightText tooltipData.speedString = speed if DECIMAL_SEPERATOR ~= "." then