mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
- user-submitted modification to last user-submitted threat fixes
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user