- hopefully fix a bug where the cast bar could sometimes try to access nil

This commit is contained in:
Parnic
2010-03-17 16:40:59 +00:00
parent 43fbe08fcd
commit 33cf05d534

View File

@ -435,6 +435,10 @@ function CastBar.prototype:SpellCastStart(unit, spell, rank)
CastBar.super.prototype.SpellCastStart(self, unit, spell, rank)
if (unit ~= self.unit) then return end
if not self:IsVisible() or not self.actionDuration then
return
end
local lag = GetTime() - (self.spellCastSent or 0)
local pos = IceHUD:Clamp(lag / self.actionDuration, 0, 1)
@ -457,6 +461,10 @@ end
function CastBar.prototype:SpellCastChannelStart(unit)
CastBar.super.prototype.SpellCastChannelStart(self, unit)
if (unit ~= self.unit) then return end
if not self:IsVisible() or not self.actionDuration then
return
end
local lag = GetTime() - (self.spellCastSent or 0)