- user-submitted modification to last user-submitted threat fixes

This commit is contained in:
Parnic
2010-03-15 02:01:30 +00:00
parent 815a866593
commit 43fbe08fcd

View File

@ -214,23 +214,14 @@ function IceThreat.prototype:Update(unit)
local isTanking, threatState, scaledPercent, rawPercent, threatValue = UnitDetailedThreatSituation("player", self.unit)
local _, _, _, _, tankThreat = UnitDetailedThreatSituation("targettarget", self.unit) -- highest threat target of target (i.e. the tank)
local scaledPercentZeroToOne, rangeMulti -- for melee and caster range threat values (1.1 or 1.3)
local rangeMulti = 1.1
local scaledPercentZeroToOne
if threatValue and threatValue < 0 then
threatValue = threatValue + 410065408 -- the corrected threat while under MI or Fade
if isTanking then
tankThreat = threatValue
end
end
if not self.combat and (scaledPercent == 0 or rawPercent == 0) then
self:Show(false)
return
end
if not rawPercent then
rawPercent = 0
end
if threatValue and tankThreat then -- Corrects rawPercent and scaledPercent while under MI or Fade
rawPercent = ((threatValue / tankThreat) * 100)
@ -242,6 +233,16 @@ function IceThreat.prototype:Update(unit)
end
scaledPercent = ((threatValue / rangeMulti) * 100)
end
end
if not self.combat and (scaledPercent == 0 or rawPercent == 0) then
self:Show(false)
return
end
if not rawPercent then
rawPercent = 0
end
if rawPercent < 0 then
rawPercent = 0