From b2c8ed9c44ab8beb6f1793cff70a47ec81cc2eda Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Tue, 11 Jan 2022 00:00:17 +0100 Subject: [PATCH] fixed spec detection --- Modules/Cooldowns.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Modules/Cooldowns.lua b/Modules/Cooldowns.lua index 1ab006d..bf30c5d 100644 --- a/Modules/Cooldowns.lua +++ b/Modules/Cooldowns.lua @@ -338,13 +338,24 @@ function Cooldowns:CooldownReady(button, spellId, frame) end end +local function notIn(spec, list) + for _,v in ipairs(list) do + if spec == v then + return false + end + end + return true +end + function Cooldowns:DetectSpec(unit, spec) local button = Gladdy.buttons[unit] if (not button or not spec or button.spec) then return end - if button.class == "PALADIN" and (spec ~= L["Holy"] or spec ~= L["Retribution"]) then + if button.class == "PALADIN" and notIn(spec, {L["Holy"], L["Retribution"], L["Protection"]}) + or button.class == "SHAMAN" and notIn(spec, {L["Restoration"], L["Enhancement"], L["Elemental"]}) + or button.class == "WARRIOR" and notIn(spec, {L["Arms"], L["Protection"], L["Fury"]}) then return end