From 48ebec985bf9f2c03751b316c9a5868f9a895cbd Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Sun, 17 May 2026 10:52:50 +0200 Subject: [PATCH] coa: fix CoA dispel detection timing in SUF aura scan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous approach baked playerCoaDispels into group.coaRaidFilter during OnLayoutApplied, which can fire before PLAYER_LOGIN when C_Player isn't ready yet — Venomancer and other CoA classes got cached as false and never re-evaluated. Fix: move all CoA logic into scan() itself so it runs on every PLAYER_ENTERING_WORLD update. getCoaDispels() no longer caches when C_Player is unavailable (returns nil without storing), so the first successful in-world call populates it correctly. updateGroup() is restored to its original form — no group.coaRaidFilter. scan() intercepts filter=="HARMFUL|RAID", calls getCoaDispels(), and if a dispel set is found strips |RAID and applies the per-type check inline. --- ShadowedUnitFrames/modules/auras.lua | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/ShadowedUnitFrames/modules/auras.lua b/ShadowedUnitFrames/modules/auras.lua index 8f95e0d..4ce8168 100644 --- a/ShadowedUnitFrames/modules/auras.lua +++ b/ShadowedUnitFrames/modules/auras.lua @@ -21,7 +21,12 @@ local COA_CLASS_DISPELS = { local function getCoaDispels() if playerCoaDispels ~= nil then return playerCoaDispels end local cp = _G.C_Player - if cp and cp.IsCustomClass and cp:IsCustomClass() then + if not cp or not cp.IsCustomClass then + -- C_Player not yet initialised (called before PLAYER_LOGIN); don't + -- cache — retry on the next scan so we pick it up once in-world. + return nil + end + if cp:IsCustomClass() then local _, token = UnitClass("player") playerCoaDispels = token and COA_CLASS_DISPELS[token] or false else @@ -337,17 +342,7 @@ local function updateGroup(self, type, config, reverseConfig) -- This is a bit of an odd filter, when used with a HELPFUL filter, it will only return buffs you can cast on group members -- When used with HARMFUL it will only return debuffs you can cure if( config.raid ) then - local coa = group.type == "debuffs" and getCoaDispels() - if coa then - -- CoA custom class: keep filter as plain "HARMFUL" and let scan() - -- apply the per-type check via group.coaRaidFilter. - group.coaRaidFilter = coa - else - group.filter = group.filter .. "|RAID" - group.coaRaidFilter = nil - end - else - group.coaRaidFilter = nil + group.filter = group.filter .. "|RAID" end for id, button in pairs(group.buttons) do @@ -517,6 +512,13 @@ end local function scan(parent, frame, type, config, filter) if( frame.totalAuras >= frame.maxAuras or not config.enabled ) then return end + -- CoA: |RAID is not honoured for custom classes; override with manual type check. + local coaFilter + if filter == "HARMFUL|RAID" then + coaFilter = getCoaDispels() + if coaFilter then filter = "HARMFUL" end + end + local isFriendly = UnitIsFriend(frame.parent.unit, "player") local index = 0 while( true ) do @@ -524,7 +526,7 @@ local function scan(parent, frame, type, config, filter) local name, rank, texture, count, auraType, duration, endTime, caster, isStealable = UnitAura(frame.parent.unit, index, filter) if( not name ) then break end - if( ( not frame.coaRaidFilter or (auraType and frame.coaRaidFilter[auraType]) ) and ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and parent.whitelist[name] or parent.blacklist[type] and not parent.blacklist[name] ) ) then + if( ( not coaFilter or (auraType and coaFilter[auraType]) ) and ( not config.player or playerUnits[caster] ) and ( not parent.whitelist[type] and not parent.blacklist[type] or parent.whitelist[type] and parent.whitelist[name] or parent.blacklist[type] and not parent.blacklist[name] ) ) then -- Create any buttons we need frame.totalAuras = frame.totalAuras + 1 if( #(frame.buttons) < frame.totalAuras ) then