Fix stale targetless Trygon trigger#3744
Conversation
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
[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
- 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( |
There was a problem hiding this comment.
[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).
| 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
- Every rules-touching line of engine code must carry a comment of the form CR : . (link)
No description provided.