- hopefully fixed a bug with max'ing out the player's mana bar with a mana potion, life tap, mana gem, etc.; now letting the animation finish out normally before turning off the OnUpdate

This commit is contained in:
Parnic
2008-11-02 21:13:45 +00:00
parent 2814ba0d20
commit efcbb55286

View File

@ -128,7 +128,21 @@ function PlayerMana.prototype:SetupOnUpdate(enable)
if enable then
self.frame:SetScript("OnUpdate", function() self:Update(self.unit) end)
else
self.frame:SetScript("OnUpdate", nil)
-- make sure the animation has a chance to finish filling up the bar before we cut it off completely
if self.CurrScale ~= self.DesiredScale then
self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end)
else
self.frame:SetScript("OnUpdate", nil)
end
end
end
function PlayerMana.prototype:MyOnUpdate()
PlayerMana.super.prototype.MyOnUpdate(self)
if self.CurrScale == self.DesiredScale then
self:SetupOnUpdate(false)
end
end