Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
OnRestorecallback for theAurasystem, 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:
OnRestorecallback type and field to theAurastruct, allowing custom restoration logic when an aura's state is restored [1] [2].Activatemethod to delegate to a new internalactivatemethod, which takes atriggerOnGainparameter to control whetherOnGainis called [1] [2].RestoreStateto use the newOnRestorecallback when present, ensuring periodic actions are restarted properly and avoiding issues like double-stacking.Periodic stacking aura improvements:
NewTemporaryStatBuffWithStacksto use a helper function (startStackingAction) for starting periodic actions.OnRestorecallback 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.