From 4c06c56dea803282d3969221a530841ed1a22108 Mon Sep 17 00:00:00 2001 From: Xinhuan Date: Fri, 2 Jan 2009 08:28:08 +0800 Subject: [PATCH] Add 410065408 threat to all players with negative threat for display purposes. English translation: You can now see the "un-Faded/un-MIed threat" of players under the effects of Fade and Mirror Image. --- Omen.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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