Skip to content

Fixed AbilityEndListener filtering and improved TryGetAbility source matching.#42

Merged
lextatic merged 6 commits into
mainfrom
bugfix/ability-end-listener-node-not-filtering-ability-data
Jul 20, 2026
Merged

Fixed AbilityEndListener filtering and improved TryGetAbility source matching.#42
lextatic merged 6 commits into
mainfrom
bugfix/ability-end-listener-node-not-filtering-ability-data

Conversation

@lextatic

@lextatic lextatic commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Fixed

  • Fixed AbilityEndListener node not filtering abilities by AbilityData from different sources.

Changed

  • Refactored TryGetAbility to match any sources with null source parameter.

@lextatic lextatic added the fixed General bug fixes label Jul 19, 2026
@lextatic
lextatic requested a review from Copilot July 19, 2026 14:55
@lextatic lextatic changed the title Fixed AbilityEndListener node not filtering abilities by AbilityData from different sources. Fixed AbilityEndListener node not filtering abilities from different sources. Jul 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 AbilityData matching 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.

Comment thread Forge/Statescript/Nodes/State/AbilityEndListenerNode.cs
Comment thread Forge/Statescript/Nodes/State/AbilityEndListenerNodeContext.cs
@lextatic lextatic changed the title Fixed AbilityEndListener node not filtering abilities from different sources. Fixed AbilityEndListener filtering and improved TryGetAbility source matching. Jul 19, 2026
@lextatic
lextatic requested a review from Copilot July 19, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread Forge/Core/EntityAbilities.cs
Comment thread docs/statescript/nodes/state/ability-end-listener-node.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)!

Comment thread Forge/Statescript/Properties/GetAbilityHandleResolver.cs Outdated
@lextatic
lextatic merged commit 18f94ac into main Jul 20, 2026
1 check passed
@lextatic
lextatic deleted the bugfix/ability-end-listener-node-not-filtering-ability-data branch July 20, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants