From f29985a06eafed7fe314c76b26b61455bed32625 Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Sun, 7 Aug 2022 07:08:14 +0200 Subject: [PATCH] fix cooldown trigger twice --- Modules/Cooldowns.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/Cooldowns.lua b/Modules/Cooldowns.lua index 72781b9..deb541b 100644 --- a/Modules/Cooldowns.lua +++ b/Modules/Cooldowns.lua @@ -447,9 +447,17 @@ function Cooldowns:CooldownStart(button, spellId, duration, start) if not duration or duration == nil or type(duration) ~= "number" then return end + local cooldown = Gladdy:GetCooldownList()[button.class][spellId] + if type(cooldown) == "table" then + if (button.spec ~= nil and cooldown[button.spec] ~= nil) then + cooldown = cooldown[button.spec] + else + cooldown = cooldown.cd + end + end for _,icon in pairs(button.spellCooldownFrame.icons) do if (icon.spellId == spellId) then - if not start and icon.active and icon.timeLeft > Gladdy:GetCooldownList()[button.class][spellId].cd/2 then + if not start and icon.active and icon.timeLeft > cooldown/2 then return -- do not trigger cooldown again end icon.active = true