Skip to content

Conversation

@Saji-Saji
Copy link

This pull request introduces a new OnRestore callback for the Aura system, enabling more precise and bug-free restoration of auras with periodic effects (such as stack-based buffs) when restoring simulation state (e.g., after Alter Time). The changes ensure that periodic actions are restarted correctly without duplicating effects or miscounting stacks, and refactor the relevant aura logic for clarity and maintainability.

Aura system enhancements:

  • Added a new OnRestore callback type and field to the Aura struct, allowing custom restoration logic when an aura's state is restored [1] [2].
  • Refactored the Activate method to delegate to a new internal activate method, which takes a triggerOnGain parameter to control whether OnGain is called [1] [2].
  • Updated RestoreState to use the new OnRestore callback when present, ensuring periodic actions are restarted properly and avoiding issues like double-stacking.

Periodic stacking aura improvements:

  • Refactored the stacking logic in NewTemporaryStatBuffWithStacks to use a helper function (startStackingAction) for starting periodic actions.
  • Implemented the OnRestore callback for stacking auras to correctly restart periodic actions with the right number of remaining ticks and without triggering immediate extra stacks, fixing bugs with state restoration.

- Add OnRestore callback to Aura for proper state restoration
- Refactor Activate into public method and internal activate(sim, triggerOnGain)
- Update RestoreState to use OnRestore when available
- Update NewTemporaryStatBuffWithStacks with OnExpire and OnRestore callbacks

Fixes issues with Wushoolay's Final Choice trinket and similar stacking
proc trinkets when used with Alter Time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants