fix cooldown trigger twice

This commit is contained in:
Sumsebrum 2022-08-07 07:08:14 +02:00
parent 70acab71e9
commit f29985a06e
1 changed files with 9 additions and 1 deletions

View File

@ -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