From 63c929ceb6390155b37209e5c35f58ee6f6b8371 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Sat, 29 Aug 2026 11:04:31 +0200 Subject: [PATCH] Stable V34 AutoFix: sync target automatically --- src/outline/addon/Outline.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/outline/addon/Outline.lua b/src/outline/addon/Outline.lua index 6a70d46..a3d84c2 100644 --- a/src/outline/addon/Outline.lua +++ b/src/outline/addon/Outline.lua @@ -8,11 +8,28 @@ BINDING_HEADER_OUTLINE = "Outline" local frame = CreateFrame("Frame") frame:RegisterEvent("ADDON_LOADED") frame:RegisterEvent("PLAYER_LOGIN") +frame:RegisterEvent("PLAYER_TARGET_CHANGED") + +local syncElapsed = 0 frame:SetScript("OnEvent", function() if event == "PLAYER_LOGIN" then + OutlineSyncTarget() local on = OutlineCommand() DEFAULT_CHAT_FRAME:AddMessage("|cff00ff00Outline|r v" .. OUTLINE_VERSION .. " loaded (" .. (on and "enabled" or "disabled") .. ")") + elseif event == "PLAYER_TARGET_CHANGED" then + OutlineSyncTarget() + syncElapsed = 0 + end +end) + +-- AutoFix safety net: republish the current target from the safe Lua/main +-- thread at low frequency so a missed/early target event cannot disable Outline. +frame:SetScript("OnUpdate", function() + syncElapsed = syncElapsed + arg1 + if syncElapsed >= 0.10 then + syncElapsed = 0 + OutlineSyncTarget() end end)