From 06b3ae8d22bd2f076f00c25d72d989593c7917e2 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Mon, 7 Sep 2026 18:39:28 -0500 Subject: [PATCH] cooldown: stop shadowing the global time() `local time = time()` bound the timestamp over the top of the time function inside that branch, so any later call in the same scope would have indexed a number. Nothing did, but the name is a trap. Call it currentTime. --- modules/cooldown.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/cooldown.lua b/modules/cooldown.lua index 6bf2ca0e..1f42db37 100644 --- a/modules/cooldown.lua +++ b/modules/cooldown.lua @@ -43,13 +43,13 @@ pfUI:RegisterModule("cooldown", function () else -- I have absolutely no idea, but it works: -- https://github.com/Stanzilla/WoWUIBugs/issues/47 - local time = time() - local startupTime = time - now + local currentTime = time() + local startupTime = currentTime - now -- just a simplification of: ((2^32) - (start * 1000)) / 1000 local cdTime = (2 ^ 32) / 1000 - this.start local cdStartTime = startupTime - cdTime local cdEndTime = cdStartTime + this.duration - local remaining = cdEndTime - time + local remaining = cdEndTime - currentTime if remaining >= 0 then this.text:SetText(GetColoredTimeString(remaining))