From 0c7b9bc433789d4060832b31b0e3cd95051d82db Mon Sep 17 00:00:00 2001 From: Infus Date: Sat, 26 Aug 2023 12:30:12 +0200 Subject: [PATCH] BT2: Update auras 2s after initial login On initial login tooltips are missing, so 2s after login simply recheck all units with auras. Fixes: #4572 --- WeakAuras/BuffTrigger2.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index d3e8ae705c..9a8974b462 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -439,7 +439,11 @@ local function UpdateMatchData(time, matchDataChanged, unit, index, auraInstance -- Tell old auras that used this match data for id, triggerData in pairs(data.auras) do for triggernum in pairs(triggerData) do - if matchDataByTrigger[id] and matchDataByTrigger[id][triggernum] and matchDataByTrigger[id][triggernum][unit] and matchDataByTrigger[id][triggernum][unit][key] then + if matchDataByTrigger[id] + and matchDataByTrigger[id][triggernum] + and matchDataByTrigger[id][triggernum][unit] + and matchDataByTrigger[id][triggernum][unit][key] + then matchDataByTrigger[id][triggernum][unit][key] = nil matchDataChanged[id] = matchDataChanged[id] or {} matchDataChanged[id][triggernum] = true @@ -2137,6 +2141,17 @@ local function EventHandler(frame, event, arg1, arg2, ...) tinsert(unitsToRemove, unit) end end + + if arg1 then + -- Initial login has a bug where the tooltip information is not available, + -- so update tooltips 2s after login + C_Timer.After(2, function() + for unit, matchtDataPerUnit in pairs(matchData) do + EventHandler(frame, "UNIT_AURA", unit) + end + end) + end + elseif event == "RAID_TARGET_UPDATE" then ScanRaidMarkScanFunc(matchDataChanged) elseif event == "UNIT_TARGETABLE_CHANGED" then