Fixed AbilityEndListener filtering and improved TryGetAbility source matching.#42
Merged
lextatic merged 6 commits intoJul 20, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the AbilityEndListenerNode’s filtering mechanism to match ended abilities by AbilityData (instead of a single resolved AbilityHandle), addressing cases where the same AbilityData is granted from different sources and/or granted after the node has activated.
Changes:
- Replace handle-based filtering with
AbilityData-based filtering in the listener node and its runtime context. - Add tests covering filtering when an ability is granted with a source and when it’s granted after listener activation.
- Update node documentation to reflect the new per-event
AbilityDatamatching behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Forge/Statescript/Nodes/State/AbilityEndListenerNodeContext.cs | Switches stored filter from AbilityHandle to AbilityData in node context. |
| Forge/Statescript/Nodes/State/AbilityEndListenerNode.cs | Captures AbilityData on activate and filters ended events by the ended ability’s AbilityData. |
| Forge.Tests/Statescript/Nodes/State/ListenerNodesTests.cs | Adds regression tests for source-granted abilities and post-activation grants. |
| docs/statescript/nodes/state/ability-end-listener-node.md | Updates documented behavior to describe per-event matching by AbilityData. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
Forge/Abilities/Ability.cs:554
- The pragma comment "Remove unnecessary suppression" corresponds to IDE0079, but the code disables/restores IDE0370. If the intent is to keep the S3011 suppression without IDE0079 complaining, this likely won’t suppress the right diagnostic and can reintroduce analyzer warnings (or fail builds if warnings are treated as errors).
#pragma warning disable IDE0370 // Remove unnecessary suppression
#pragma warning disable S3011 // Reflection should not be used to increase accessibility of classes, methods, or fields
// Do not attempt this in production environments without adult supervision.
MethodInfo method = typeof(Ability)
.GetMethod(nameof(SubscribeTypedEventCore), BindingFlags.NonPublic | BindingFlags.Instance)!
lextatic
deleted the
bugfix/ability-end-listener-node-not-filtering-ability-data
branch
July 20, 2026 00:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixed
Changed