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).
This commit is contained in:
2026-05-25 11:51:03 +02:00
parent 83bbe12a87
commit 5035f39364
2 changed files with 26 additions and 1 deletions
+2
View File
@@ -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"])
+24 -1
View File
@@ -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