Use UnitPowerMax where available

This commit is contained in:
Parnic
2022-09-18 15:22:04 -05:00
parent d10586d477
commit a259db6b8a
2 changed files with 17 additions and 9 deletions

View File

@ -376,14 +376,18 @@ function RollTheBones.prototype:UpdateDurationBar(event, unit)
end
local points = RTBGetComboPoints(self.unit)
-- check for Deeper Stratagem
local _, _, _, DeeperStratagem = GetTalentInfoByID(sixComboPointsTalentID, GetActiveSpecGroup())
if DeeperStratagem then
-- first, set the cached upper limit of RtB duration
CurrMaxRtBDuration = self:GetMaxBuffTime(maxComboPoints + 1)
if UnitPowerMax then
CurrMaxRtBDuration = self:GetMaxBuffTime(UnitPowerMax(self.unit, SPELL_POWER_COMBO_POINTS))
else
CurrMaxRtBDuration = self:GetMaxBuffTime(maxComboPoints)
-- check for Deeper Stratagem
local _, _, _, DeeperStratagem = GetTalentInfoByID(sixComboPointsTalentID, GetActiveSpecGroup())
if DeeperStratagem then
-- first, set the cached upper limit of RtB duration
CurrMaxRtBDuration = self:GetMaxBuffTime(maxComboPoints + 1)
else
CurrMaxRtBDuration = self:GetMaxBuffTime(maxComboPoints)
end
end
if event then