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:
Parnic
2016-05-18 00:04:29 -05:00
parent a9e96ca151
commit efc25bdb9c

View File

@ -4,7 +4,7 @@ local CastBar = IceCore_CreateClass(IceCastBar)
local IceHUD = _G.IceHUD
CastBar.prototype.spellCastSent = nil
CastBar.prototype.sentSpell = nil
-- Constructor --
function CastBar.prototype:init()
@ -409,6 +409,7 @@ function CastBar.prototype:SpellCastSent(event, unit, spell, rank, target)
if (unit ~= self.unit) then return end
self.spellCastSent = GetTime()
self.sentSpell = spell
end
-- OVERRIDE
@ -420,6 +421,10 @@ function CastBar.prototype:SpellCastStart(event, unit, spell, rank)
return
end
if self.sentSpell ~= spell then
self.spellCastSent = nil
end
local scale
if self.unit == "vehicle" then
scale = 0