Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetTotemInfo's startTime / duration is wrong #651

Closed
mrbuds opened this issue Sep 4, 2024 · 3 comments
Closed

GetTotemInfo's startTime / duration is wrong #651

mrbuds opened this issue Sep 4, 2024 · 3 comments
Labels
Acknowledged by Blizzard We received word from Blizzard that this is being tracked internally Bug Something isn't working Mainline This issue affects the current live Retail client

Comments

@mrbuds
Copy link
Collaborator

mrbuds commented Sep 4, 2024

Tests with some shaman totems show that time data from GetTotemInfo and GetTotemTimeLeft does not match, with sometime more than 1 second of difference

When using a totem that give a buff, GetTotemTimeLeft timer is much closer to the timer of the buff
GetTotemTimeLeft returned value is rounded with math.ceil, which make it not precise / usable

local f = CreateFrame("Frame")
f:SetScript("OnUpdate", function()
      local a = GetTotemTimeLeft(1)
      
      local _, _, startTime, duration = GetTotemInfo(1)
      local expirationTime = startTime and (startTime + duration) or 0;
      local b =  startTime and startTime > 0 and expirationTime - GetTime() or 0
      
      local sltInfo = C_UnitAuras.GetPlayerAuraBySpellID(325174) -- spirit link totem buff
      local slt = sltInfo and true or false 

      if slt then print(a, b, slt) end
end)
f:Show()
Wow_2024-09-03_14-48-34.mp4

With this demo using SLT, note how when SLT buff fade the timer from GetTotemInfo is off by 1.138s
and timer from GetTotemTimeLeft is off by 0.189s

Also not shown with this code, PLAYER_TOTEM_UPDATE event time match closer to GetTotemTimeLeft too but isn't perfect

@mrbuds mrbuds added Bug Something isn't working Mainline This issue affects the current live Retail client labels Sep 4, 2024
@InfusOnWoW
Copy link
Collaborator

This is quite annoying for us in WeakAuras, we have looked into whether we can workaround that but couldn't come up with an workaround that does feel reasonably robust. So we would love to have this fixed. (And we'd love to see an spell id added when this eventually moves to C_Spell.)

@Meorawr Meorawr added the Acknowledged by Blizzard We received word from Blizzard that this is being tracked internally label Jan 9, 2025
@Meorawr
Copy link
Collaborator

Meorawr commented Jan 9, 2025

I'd advise re-testing in the next 11.1 PTR build. Also I slightly tweaked the snippet so that it doesn't endlessly spam the chat frame while Spirit Link Totem isn't active, and fixed the CreateFrame typo.

@Meorawr
Copy link
Collaborator

Meorawr commented Jan 29, 2025

Marking as resolved as of 11.1.0.58819 - or at the very least, improved. The values obtained from both APIs no longer disagree with one another, and the accuracy with relation to the SLT buff is slightly improved (~0.2s or so difference between the totem hitting zero and the SLT buff disappearing, but I think that's just because they're two very different systems).

@Meorawr Meorawr closed this as completed Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Acknowledged by Blizzard We received word from Blizzard that this is being tracked internally Bug Something isn't working Mainline This issue affects the current live Retail client
Projects
None yet
Development

No branches or pull requests

3 participants