Skip to content

Commit

Permalink
Minor improvement to combat potency skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed May 23, 2021
1 parent e4b0ea6 commit 9dee707
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions NugEnergy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,12 @@ local ClassicTickerOnUpdate = function(self)
(diff < 42 and currentEnergy == UnitPowerMax("player", PowerTypeIndex)) -- including tick to cap, but excluding thistle tea
then
possibleTick = true

local now = GetTime()
if now - externalManaGainTimestamp < 0.02 then
externalManaGainTimestamp = 0
possibleTick = false
end
end
elseif PowerTypeIndex == Enum_PowerType_Mana then
possibleTick = true
Expand All @@ -383,9 +389,9 @@ local ClassicTickerOnUpdate = function(self)
end
lastEnergyValue = currentEnergy
end
ClassicTickerFrame.Enable = function(self, trackManaGains)
ClassicTickerFrame.Enable = function(self, trackEnergize)
self:SetScript("OnUpdate", ClassicTickerOnUpdate)
if trackManaGains then
if trackEnergize then
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
end
self.isEnabled = true
Expand Down Expand Up @@ -462,7 +468,7 @@ function NugEnergy.Initialize(self)

if isClassicTicker and NugEnergyDB.enableClassicTicker then
GetPower = GetPower_ClassicRogueTicker(nil, 19, 0, false)
ClassicTickerFrame:Enable()
ClassicTickerFrame:Enable(true)
self:SetScript("OnUpdate",self.UpdateEnergy)
self:UpdateBarEffects() -- Will Disable Smoothing
NugEnergy.UNIT_MAXPOWER = UNIT_MAXPOWER_ClassicTicker
Expand Down Expand Up @@ -521,7 +527,7 @@ function NugEnergy.Initialize(self)
NugEnergy.UNIT_MAXPOWER = UNIT_MAXPOWER_ClassicTicker
self:UnregisterEvent("UNIT_POWER_FREQUENT")
self:SetScript("OnUpdate",self.UpdateEnergy)
ClassicTickerFrame:Enable()
ClassicTickerFrame:Enable(true)
self:UpdateBarEffects()
else
GetPower = RageBarGetPower(nil, 5, nil, true)
Expand Down

0 comments on commit 9dee707

Please sign in to comment.