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

Bossmod Timer fix #4584

Merged
merged 3 commits into from
Sep 3, 2023
Merged

Bossmod Timer fix #4584

merged 3 commits into from
Sep 3, 2023

Conversation

mrbuds
Copy link
Contributor

@mrbuds mrbuds commented Aug 26, 2023

fix #4583

mrbuds and others added 2 commits August 26, 2023 19:42
… not shown when remainingTime + extendTimer would start a bar after non modified timer has expired
@@ -471,6 +478,9 @@ Private.event_prototypes["DBM Timer"] = {
end
end
if remainingTime >= triggerRemaining and not bar.paused then
if extendTimer >= triggerRemaining then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because RecheckTimers can run at any time (due to it being triggered also by boss mod events), and RecheckTimers needs to know whether to keep a bar alive or not, I think we need to write scheduledScanExpiresAt regardless of any triggerRemainingCheck, and this check should be extendTimer > 0.

So this code should probably use extendTimer > 0, and we also need to move it out of the remainingTime check and it needs to be duplicated in the else branch ~7 lines below.

@@ -127,7 +127,9 @@ Private.ExecEnv.BossMods.DBM = {
for timerId, bar in pairs(self.bars) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. For the nextExpire we should also take scheduleScanExpire into account, that is I think we should add:
if self.nextExpire == nil then
     self.nextExpire = bar.scheduledScanExpireAt
elseif bar.scheduledScanExpireAt and bar.scheduledScanExpireAt > GetTime() and bar.scheduledScanExpireAt< self.nextExpire
    self.nextExpire= self.scheduledScanExpireAt
end

So that, at scheduledScanExpireAt the bar is actually removed.

  1. For extended timers, we end up sending a TimerStop event everytime RecheckTimers is called. That doesn't sound too bad, though it's bit unfortunate.

  2. Another point to consider is that this changes GetTimer/GetAllTimers beahviour in that they can and will now return expired bars (if they are kept alive via an extension). Looking at the code I think some callers of that need adjustment to not consider expired timers. In general GetTimer/GetAllTimers returning expired bars is correct, in so far as we explictly want to keep them around. But we need to add checks for auras that aren't responsible for the extension.

That is consider two auras:
Aura a: Shows 'foo', extends timers by 5s
Aura b: Shows all bars, no extension.

Then if a bar 'foo' expires (for which aura a matches), the bar is kept alive via the scheduledScanExpireAt code.

If in those 5s a DBM_TimerUpdate is fired for an unrelated timer, e.g. bar 'baz'
Then for Aura b, that will result in WeakAuras.ScanEvents('BossMod_TimerUpdate'), then the code (in useClone) will use:

  • TimerMatchesGeneric, which doesn't care that the bar is expired
  • copyAndSchedule, which again doesn't check that remainingTime is negative, to
  • CopyBarToState, which doesn't check either.

So Aura b shows a dead timer.

else
if self.nextExpire == nil then
self.nextExpire = bar.scheduledScanExpireAt
elseif bar.scheduledScanExpireAt < self.nextExpire then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't bar.scheduledScanExpireAt be nil here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No if it is nil (or <= GetTime()) we would be in line 130

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed sorry

your changes are good, i did only tests with auto-clone and didn't think enough about nextExpire

@InfusOnWoW InfusOnWoW merged commit 12432b7 into WeakAuras:main Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bigwigs timer triggers don't fire if offset timer >= remaining time
2 participants