From 0dd7b0ed4cb1cb84804aff5fa47856c40eae9a77 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Sat, 5 Sep 2026 15:31:58 +0200 Subject: [PATCH] Align Minimap Clock updates to minute boundaries --- mods/minimap-clock.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mods/minimap-clock.lua b/mods/minimap-clock.lua index 81a7896..25f3123 100644 --- a/mods/minimap-clock.lua +++ b/mods/minimap-clock.lua @@ -67,8 +67,16 @@ module.enable = function(self) MinimapClock.text:SetText(date("%H:%M")) end - updateclock() - MinimapClock.ticker = C_Timer.NewTicker(1, updateclock) + local function scheduleclock() + updateclock() + + -- Recalculate the next minute boundary every time so delayed callbacks, + -- alt-tab stalls or local clock adjustments cannot accumulate drift. + local seconds = tonumber(date("%S")) or 0 + C_Timer.After(60 - seconds, scheduleclock) + end + + scheduleclock() local timertext = MinimapTimer:CreateFontString(nil, "LOW", "GameFontNormal") timertext:SetFont(STANDARD_TEXT_FONT, 12, "OUTLINE")