Skip to content

Fix stale targetless Trygon trigger#3744

Merged
matthewevans merged 2 commits into
mainfrom
ship/fix-stale-targetless-trygon-trigger
Jun 19, 2026
Merged

Fix stale targetless Trygon trigger#3744
matthewevans merged 2 commits into
mainfrom
ship/fix-stale-targetless-trygon-trigger

Conversation

@matthewevans

Copy link
Copy Markdown
Member

No description provided.

@matthewevans matthewevans enabled auto-merge June 18, 2026 20:02

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request implements handling for triggered abilities and resolving spells with missing or illegal required stack-time targets in crates/engine/src/game/stack.rs, adhering to CR 603.3d and CR 608.2b. It introduces helper functions to detect these states and clear stale pending triggers, along with a corresponding unit test. The review feedback correctly points out that the new rules-touching helper functions lack the mandatory CR annotations required by Rule R6 of the repository style guide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

state.objects.get(&id).is_some_and(|obj| obj.zone == zone)
}

fn has_missing_required_stack_targets(state: &GameState, ability: &ResolvedAbility) -> bool {

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.

medium

[MEDIUM] Missing CR annotation on rules-touching function has_missing_required_stack_targets.\n\nWhy it matters: Every rules-touching line of engine code must carry a comment of the form CR <number>: <description> per the repository style guide (Rule R6).\n\nSuggested fix: Add a doc comment with the relevant CR citations (CR 603.3d and CR 608.2b).

/// CR 603.3d + CR 608.2b: Checks if a triggered ability or resolving spell is missing required stack-time targets.
fn has_missing_required_stack_targets(state: &GameState, ability: &ResolvedAbility) -> bool {
References
  1. Every rules-touching line of engine code must carry a comment of the form CR : . (link)

}
}

fn top_pending_trigger_has_no_legal_required_targets(

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.

medium

[MEDIUM] Missing CR annotation on rules-touching function top_pending_trigger_has_no_legal_required_targets.\n\nWhy it matters: Every rules-touching line of engine code must carry a comment of the form CR <number>: <description> per the repository style guide (Rule R6).\n\nSuggested fix: Add a doc comment with the relevant CR citation (CR 603.3d).

Suggested change
fn top_pending_trigger_has_no_legal_required_targets(
/// CR 603.3d: Checks if the top pending trigger has no legal required targets.
fn top_pending_trigger_has_no_legal_required_targets(
References
  1. Every rules-touching line of engine code must carry a comment of the form CR : . (link)

@matthewevans matthewevans added this pull request to the merge queue Jun 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 18, 2026
@matthewevans matthewevans added this pull request to the merge queue Jun 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 19, 2026
@matthewevans matthewevans added this pull request to the merge queue Jun 19, 2026
Merged via the queue into main with commit a00831a Jun 19, 2026
10 checks passed
@matthewevans matthewevans deleted the ship/fix-stale-targetless-trygon-trigger branch June 19, 2026 00:20
@matthewevans matthewevans added the bug Bug fix label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant