Skip to content

Commit

Permalink
fix an edge case bug with cooldown scanning; closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
gallantron committed May 27, 2022
1 parent 31019d1 commit 9ddcbc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 9 additions & 11 deletions PallyPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1300,17 +1300,15 @@ function PallyPower:ScanCooldowns()
local CooldownInfo = AllPallys[self.player].CooldownInfo
for cd, spells in pairs(self.Cooldowns) do
for _, spell in pairs(spells) do
if not CooldownInfo[cd] then
return
end
if GetSpellCooldown(spell) then
CooldownInfo[cd].start = GetSpellCooldown(spell)
CooldownInfo[cd].duration = select(2, GetSpellCooldown(spell))
CooldownInfo[cd].remaining = CooldownInfo[cd].start + CooldownInfo[cd].duration - GetTime()
if CooldownInfo[cd].remaining < 0 then
CooldownInfo[cd].remaining = 0
end
end
if CooldownInfo[cd] then
local start, duration = GetSpellCooldown(spell)
if start then
CooldownInfo[cd].start = start
CooldownInfo[cd].duration = duration
CooldownInfo[cd].remaining = math.max(start + duration - GetTime(), 0)
break
end
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion PallyPowerValues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ PallyPower.Auras = {
}

PallyPower.Cooldowns = {
[1] = {633, 2800, 10310, 27154}, -- Improved Lay On Hands
[1] = {633, 2800, 10310, 27154}, -- Lay On Hands
[2] = {19752}, -- Divine Intervention
}

Expand Down

0 comments on commit 9ddcbc7

Please sign in to comment.