diff --git a/frames/window_breakdown/breakdown_spells_spellframes.lua b/frames/window_breakdown/breakdown_spells_spellframes.lua index e16ab7cc..412108ef 100644 --- a/frames/window_breakdown/breakdown_spells_spellframes.lua +++ b/frames/window_breakdown/breakdown_spells_spellframes.lua @@ -115,7 +115,7 @@ local onEnterSpellTarget = function(targetFrame) end ---@type number the top value of targets - local topValue = targets[1] and targets[1][2] or 0 + local topValue = math.max(targets[1] and targets[1][2] or 0, 0.001) local cooltip = GameCooltip cooltip:Preset(2) diff --git a/frames/window_breakdown/breakdown_spells_targetframes.lua b/frames/window_breakdown/breakdown_spells_targetframes.lua index b19924f8..a84d0bfc 100644 --- a/frames/window_breakdown/breakdown_spells_targetframes.lua +++ b/frames/window_breakdown/breakdown_spells_targetframes.lua @@ -148,7 +148,7 @@ local updateTargetBar = function(targetBar, index, combatObject, scrollFrame, he textIndex = textIndex + 1 elseif (header.name == "percent") then - targetBar.percent = value / totalValue * 100 --totalValue is nil + targetBar.percent = value / math.max(totalValue, 0.001) * 100 --totalValue is nil ---@type string local percentFormatted = string.format("%.1f", targetBar.percent) .. "%" text:SetText(percentFormatted)