Skip to content

Commit

Permalink
fix: #2220 - GCD state not ending when GCD ends.
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Sep 7, 2024
1 parent 50c1f59 commit fd1052e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v11.0.7
* Fix: #2215 - Spell Charges condition not updating for countable spells without true charges.
* Fix: #2217 - Error in item cooldown conditions
* Fix: #2220 - GCD state not ending when GCD ends.

## v11.0.6
* #2190: Added options to Buff/Debuff icons to source stack count from tooltip numbers.
Expand Down
13 changes: 4 additions & 9 deletions Components/Core/Common/Cooldowns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,9 @@ end
-- Rogue's Backstab. We don't need class spells anymore - any GCD spell works fine.
local GCDSpell = 53
TMW.GCDSpell = GCDSpell
local GCD
local Cooldowns_GetSpellCooldown = Cooldowns.GetSpellCooldown
function TMW.GetGCD()
if not GCD then
GCD = Cooldowns.GetSpellCooldown(GCDSpell).duration
end
return GCD
return Cooldowns_GetSpellCooldown(GCDSpell).duration
end
local GetGCD = TMW.GetGCD

Expand All @@ -161,9 +158,8 @@ function TMW.OnGCD(d)
-- A cd of 1 (or less) is always a GCD (or at least isn't worth showing)
return true
else
-- If the duration passed in is the same as the GCD spell,
-- and the duration isnt zero, then it is a GCD
return GetGCD() == d and d > 0
-- If the duration passed in is the same as the GCD spell then it is a GCD
return GetGCD() == d
end
end

Expand All @@ -173,7 +169,6 @@ Cooldowns:RegisterEvent("SPELL_UPDATE_CHARGES")
Cooldowns:SetScript("OnEvent", function(self, event, action, inRange, checksRange)
if event == "SPELL_UPDATE_COOLDOWN" then
wipe(CachedCooldowns)
GCD = nil

if next(CachedCounts) then
-- There's not a great event for GetSpellCastCount. Cooldown is the closest we can get.
Expand Down
1 change: 1 addition & 0 deletions Options/CHANGELOG.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ TMW.CHANGELOG = [==[
## v11.0.7
* Fix: #2215 - Spell Charges condition not updating for countable spells without true charges.
* Fix: #2217 - Error in item cooldown conditions
* Fix: #2220 - GCD state not ending when GCD ends.
## v11.0.6
* #2190: Added options to Buff/Debuff icons to source stack count from tooltip numbers.
Expand Down

0 comments on commit fd1052e

Please sign in to comment.