From 5035f3936479a6340d52cd51616c49117b667168 Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Mon, 25 May 2026 11:51:03 +0200 Subject: [PATCH] fix(highlight): manual debuff scan for CoA dispel classes UnitDebuff(unit, 1, "RAID") ignores CoA custom classes, so on a Witchdoctor/Templar/etc. hasDebuff was always nil and the unit-frame border highlight never lit up on curable Poison/Disease/Magic/Curse. Fix mirrors the auras.lua shim: if ShadowUF.GetCoaDispels() returns a dispel set, scan UnitDebuff entries manually and match by dispelType. Expose getCoaDispels on the ShadowUF namespace so highlight.lua can reuse the single source of truth (COA_CLASS_DISPELS lives in auras.lua). --- ShadowedUnitFrames/modules/auras.lua | 2 ++ ShadowedUnitFrames/modules/highlight.lua | 25 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ShadowedUnitFrames/modules/auras.lua b/ShadowedUnitFrames/modules/auras.lua index 96cbc75..847e972 100644 --- a/ShadowedUnitFrames/modules/auras.lua +++ b/ShadowedUnitFrames/modules/auras.lua @@ -40,6 +40,8 @@ local function getCoaDispels() end return playerCoaDispels end +-- Expose for other modules (highlight.lua) so the dispel set stays single-source. +ShadowUF.GetCoaDispels = getCoaDispels local mainHand, offHand = {time = 0}, {time = 0} local tempEnchantScan ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"]) diff --git a/ShadowedUnitFrames/modules/highlight.lua b/ShadowedUnitFrames/modules/highlight.lua index 95bef4a..8ad86d0 100644 --- a/ShadowedUnitFrames/modules/highlight.lua +++ b/ShadowedUnitFrames/modules/highlight.lua @@ -150,6 +150,29 @@ end function Highlight:UpdateAura(frame) -- In theory, we don't need aura scanning because the first debuff returned is always one we can cure... in theory - frame.highlight.hasDebuff = UnitIsFriend(frame.unit, "player") and select(5, UnitDebuff(frame.unit, 1, "RAID")) or nil + if not UnitIsFriend(frame.unit, "player") then + frame.highlight.hasDebuff = nil + return self:Update(frame) + end + + -- CoA: "RAID" filter doesn't know about custom dispel classes (Witchdoctor, Templar, …); + -- if the player is one of those, scan all debuffs and match against our dispel set. + local coaDispels = ShadowUF.GetCoaDispels and ShadowUF.GetCoaDispels() + if coaDispels then + local hit + local i = 1 + while true do + local name, _, _, _, dispelType = UnitDebuff(frame.unit, i) + if not name then break end + if dispelType and coaDispels[dispelType] then + hit = dispelType + break + end + i = i + 1 + end + frame.highlight.hasDebuff = hit + else + frame.highlight.hasDebuff = select(5, UnitDebuff(frame.unit, 1, "RAID")) or nil + end self:Update(frame) end