fix(engine): retain tracked delayed target pins - #7300
Conversation
|
Warning Review limit reached
Next review available in: 7 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe change preserves ChangesTracked-set delayed zone changes
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Generated for head Parse changes introduced by this PR✓ No card-parse changes detected. |
119ed3a to
f7ba411
Compare
d7ecb4c to
2728351
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/engine/src/game/ability_utils.rs`:
- Around line 2097-2103: The ChangeZoneAll exemption currently skips target
validation for all filters, including real player targets. In the ChangeZoneAll
branch near validated.targets.clone(), apply the exemption only when
filter_refs_parent_target(target) (or an equivalent existing helper) is true;
otherwise run targeting::validate_targets_for_ability so illegal departed-player
targets are removed. Add a negative test covering an illegal
TargetFilter::Player target alongside the existing delayed-parent snapshot test.
In `@crates/engine/src/game/effects/change_zone.rs`:
- Around line 209-267: Replace the leaf-binding logic in
bind_delayed_parent_target_filter with the shared concrete_parent_target_filter
helper from delayed_trigger.rs. Extract or expose that helper so both
ParentTarget and ParentTargetSlot { index } use the same empty-set and
out-of-range semantics, including returning Any where required. Keep only
recursive handling of TrackedSetFiltered, And, Or, and Not local to
bind_delayed_parent_target_filter.
- Around line 269-288: Update target_pin_is_current_or_delayed_exile_successor
to bind the +1 incarnation allowance to the exact parent exile occurrence,
rather than accepting any later same-ID incarnation; use the available
tracked-object/ThisWayCause data or extend it to retain that occurrence. Ensure
delayed-exile successors are accepted only when tied to the parent exile event,
and add a regression test covering an unrelated intervening zone change.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 27fe7ddb-4348-4a42-a694-08ee3d014d81
📒 Files selected for processing (6)
crates/engine/src/game/ability_utils.rscrates/engine/src/game/effects/change_zone.rscrates/engine/src/game/effects/delayed_trigger.rscrates/engine/src/game/effects/mod.rscrates/engine/src/game/engine.rscrates/engine/src/game/filter.rs
|
Review follow-up for the current head
I could not attach these as inline replies because the account already has a pending review on this PR; this comment records the current-head disposition without modifying that review. |
b7f1bc1 to
f103370
Compare
Fixes #7100.
Rebased replacement for #7283. When a delayed
ChangeZoneis upgraded to a tracked-set mass move, retainParentTarget/slot identity through binding and evaluate its member predicate against the delayed trigger's current incarnation pin. This prevents a later incarnation from being moved while retaining the original member path.Verification:
cargo fmt --all; parser combinator and PreLowered pre-commit gates. Per workspace policy, no cargo build/test was run in this worktree.Summary by CodeRabbit