Fix energy ticker when zoning back into an instance after dying

Instead of unhooking the event when we're dead, just hide the ticker
when dead. This ensures, regardless of the order the events come in
when zoning back into an instance, reviving, etc., the ticker is always
shown when appropriate.

WowAce ticket #316
This commit is contained in:
Parnic
2021-07-06 11:34:52 -05:00
parent ec80716991
commit 60587b22f8

View File

@ -280,7 +280,7 @@ function PlayerMana.prototype:ManaType(event, unit)
if self:ShouldUseTicker() then
-- register ticker for rogue energy
if (self.moduleSettings.tickerEnabled and (self.manaType == SPELL_POWER_ENERGY) and self.alive) then
if self.moduleSettings.tickerEnabled and self.manaType == SPELL_POWER_ENERGY then
self.tickerFrame:Show()
self.tickerFrame:SetScript("OnUpdate", function() self:EnergyTick() end)
else
@ -438,7 +438,7 @@ function PlayerMana.prototype:EnergyTick()
return
end
if not (self.tickStart) then
if not self.tickStart or not self.alive then
self.tickerFrame:Hide()
return
end