From efc25bdb9c0b910e3fc5448d28b1fe559827c59e Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 18 May 2016 00:04:29 -0500 Subject: [PATCH] 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. --- modules/CastBar.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/CastBar.lua b/modules/CastBar.lua index ef5de12..b7f6399 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -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