target can use multiscan/fix overflowframe not showing more than 1 buff

This commit is contained in:
Jrc13245
2026-02-16 15:26:55 -05:00
parent 1b52082033
commit 860fca0001
2 changed files with 31 additions and 1 deletions
+17
View File
@@ -2585,6 +2585,23 @@ function CleveRoids.DoTarget(msg)
-- Save original target GUID for potential restoration (SuperWoW returns GUID as 2nd value)
local _, originalTargetGuid = UnitExists("target")
-- Handle [multiscan:priority] - use ResolveMultiscanTarget for enemy scanning
-- ResolveMultiscanTarget handles its own target save/restore internally
if conditionals.multiscan then
local scanResult = CleveRoids.ResolveMultiscanTarget(conditionals, conditionals.target)
if scanResult then
TargetUnit(scanResult)
return true
end
-- No match found - restore original target if scanning changed it
if originalTargetGuid and UnitExists(originalTargetGuid) then
TargetUnit(originalTargetGuid)
elseif not originalTargetGuid then
ClearTarget()
end
return false
end
-- Track if an explicit target was specified via @unit syntax
local explicitTarget = conditionals.target
+14 -1
View File
@@ -36,6 +36,7 @@ local targetLabelFs = nil
local updateFrame = nil
local updateElapsed = 0
local testMode = false
local dirty = false -- Flag for deferred rebuild (avoids event ordering race)
local lastPlayerCount = 0
local lastTargetCount = 0
@@ -551,6 +552,14 @@ CleveRoids.ToggleOverflowTest = ToggleTestMode
-- ============================================================================
local function OnUpdate()
updateElapsed = updateElapsed + arg1
-- Check dirty flag every frame for responsive rebuilds after AURA_CAST events.
-- By the time OnUpdate fires, the core handler has already updated OverflowBuffs.
if dirty then
dirty = false
updateElapsed = 0
RebuildFrame()
return
end
if updateElapsed < UPDATE_INTERVAL then return end
updateElapsed = 0
RefreshDurations()
@@ -570,7 +579,11 @@ ext.OnTargetChanged = function()
end
ext.OnAuraCast = function()
RebuildFrame()
-- Defer rebuild to OnUpdate: the core handler that populates OverflowBuffs
-- registers for AURA_CAST_ON_SELF later (PLAYER_ENTERING_WORLD) than this
-- extension (ADDON_LOADED), so it fires AFTER us. A direct RebuildFrame()
-- here would read stale data.
dirty = true
end
ext.OnGroupChanged = function()