From fd1052e578e389600c7fa034179ef902480caa36 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sat, 7 Sep 2024 12:31:23 -0700 Subject: [PATCH] fix: #2220 - GCD state not ending when GCD ends. --- CHANGELOG.md | 1 + Components/Core/Common/Cooldowns.lua | 13 ++++--------- Options/CHANGELOG.lua | 1 + 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c90ba7fb..24931516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/Components/Core/Common/Cooldowns.lua b/Components/Core/Common/Cooldowns.lua index 8cb03c13..b1b270ed 100644 --- a/Components/Core/Common/Cooldowns.lua +++ b/Components/Core/Common/Cooldowns.lua @@ -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 @@ -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 @@ -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. diff --git a/Options/CHANGELOG.lua b/Options/CHANGELOG.lua index a1d8139f..c8f7996f 100644 --- a/Options/CHANGELOG.lua +++ b/Options/CHANGELOG.lua @@ -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.