From e67c66a579b6c4a77a9684b03fce2db1ce08d566 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun, 2 Aug 2026 00:47:53 -0500 Subject: [PATCH] Poll marktracking fallback via C_Timer instead of OnUpdate The 1s range-change safety net ran a per-frame OnUpdate that no-oped ~59 of every 60 frames. Replace it with C_Timer.NewTicker(FALLBACK_INTERVAL, UpdateDisplay) -- one wakeup per second off the shared timer driver -- and drop the elapsed accumulator. The scanner frame is now purely event-driven. --- modules/marktracking.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/marktracking.lua b/modules/marktracking.lua index a6cea3d3..c06c53f4 100644 --- a/modules/marktracking.lua +++ b/modules/marktracking.lua @@ -27,7 +27,6 @@ pfUI:RegisterModule("marktracking", function () end local FALLBACK_INTERVAL = 1.0 -- safety net for units that come into range after marker was set - local elapsed = 0 local isUnlocked = false local ROW_HEIGHT = tonumber(C.unitframes.raidmarkerheight) or 14 local BAR_WIDTH = tonumber(C.unitframes.raidmarkerwidth) or 80 @@ -305,12 +304,7 @@ pfUI.marktracking = CreateFrame("Frame", "pfMarkTracking", UIParent) UpdateDisplay() end) - -- Fallback poll at 1s: catches units that come into range AFTER a marker was set + -- Fallback poll: catches units that come into range AFTER a marker was set -- (no event fires for that case, so we need this safety net) - scanner:SetScript("OnUpdate", function() - elapsed = elapsed + arg1 - if elapsed < FALLBACK_INTERVAL then return end - elapsed = 0 - UpdateDisplay() - end) + C_Timer.NewTicker(FALLBACK_INTERVAL, UpdateDisplay) end) \ No newline at end of file