mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
Hide lag bar for invalid conditions
For some interactables, such as specific quest-related objects in WoD, we never receive a SpellCastSent event, only a SpellCastStart. If, prior to that event, we ever failed a spell cast, we would have an outdated "spell sent time" saved off for a previous cast. This value would then get used due to us receiving a Start with no Sent and would cause the lag bar to fill the entire cast bar incorrectly. For these cases, we now no longer show the lag bar at all because we don't receive enough information from the game to compute one.
This commit is contained in:
@ -4,7 +4,7 @@ local CastBar = IceCore_CreateClass(IceCastBar)
|
|||||||
local IceHUD = _G.IceHUD
|
local IceHUD = _G.IceHUD
|
||||||
|
|
||||||
CastBar.prototype.spellCastSent = nil
|
CastBar.prototype.spellCastSent = nil
|
||||||
|
CastBar.prototype.sentSpell = nil
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function CastBar.prototype:init()
|
function CastBar.prototype:init()
|
||||||
@ -409,6 +409,7 @@ function CastBar.prototype:SpellCastSent(event, unit, spell, rank, target)
|
|||||||
if (unit ~= self.unit) then return end
|
if (unit ~= self.unit) then return end
|
||||||
|
|
||||||
self.spellCastSent = GetTime()
|
self.spellCastSent = GetTime()
|
||||||
|
self.sentSpell = spell
|
||||||
end
|
end
|
||||||
|
|
||||||
-- OVERRIDE
|
-- OVERRIDE
|
||||||
@ -420,6 +421,10 @@ function CastBar.prototype:SpellCastStart(event, unit, spell, rank)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.sentSpell ~= spell then
|
||||||
|
self.spellCastSent = nil
|
||||||
|
end
|
||||||
|
|
||||||
local scale
|
local scale
|
||||||
if self.unit == "vehicle" then
|
if self.unit == "vehicle" then
|
||||||
scale = 0
|
scale = 0
|
||||||
|
Reference in New Issue
Block a user