diff --git a/Omen.lua b/Omen.lua index 2a8dda3..0bfb090 100644 --- a/Omen.lua +++ b/Omen.lua @@ -1292,11 +1292,18 @@ local function updatethreat(unitid, mobunitid) local guid = UnitGUID(unitid) if guid and not threatTable[guid] then local isTanking, state, scaledPercent, rawPercent, threatValue = UnitDetailedThreatSituation(unitid, mobunitid) - -- Threat can be negative due to temporary threat reduction effects such as Fade and Mirror Image (-410057408). - -- So we cap the minimum threat to display at 0. We use the special value -1 to indicate nil here. - threatTable[guid] = (threatValue and (threatValue >= 0 and threatValue or 0)) or -1 - if threatValue and threatValue > topthreat then topthreat = threatValue end - if isTanking then tankGUID = guid end + if threatValue then + -- Threat can be negative due to temporary threat reduction effects such as Fade and Mirror Image (-410065408). + if threatValue < 0 then + threatValue = threatValue + 410065408 + end + if threatValue > topthreat then topthreat = threatValue end + if isTanking then tankGUID = guid end + threatTable[guid] = threatValue + else + -- We use the special value -1 to indicate nil here. + threatTable[guid] = -1 + end end end