mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 18:36:01 +00:00
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.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user