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:
@@ -40,6 +40,8 @@ local function getCoaDispels()
|
|||||||
end
|
end
|
||||||
return playerCoaDispels
|
return playerCoaDispels
|
||||||
end
|
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 mainHand, offHand = {time = 0}, {time = 0}
|
||||||
local tempEnchantScan
|
local tempEnchantScan
|
||||||
ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"])
|
ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"])
|
||||||
|
|||||||
@@ -150,6 +150,29 @@ end
|
|||||||
|
|
||||||
function Highlight:UpdateAura(frame)
|
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
|
-- 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)
|
self:Update(frame)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user