Fix Orvar copying itself instead of targeted permanent (fixes #4830) - #4852
Conversation
Resolve ParentTarget on spell-cast triggers from the triggering spell's committed object targets so copying targets a land (or other permanent) instead of defaulting to Orvar itself. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
matthewevans
left a comment
There was a problem hiding this comment.
Thanks for trying the narrower Orvar fix. I’m requesting changes on the current head.
-
The new regression test does not discriminate the bug it claims to cover.
orvar_copies_targeted_land_not_itselfonly asserts that permanent count increased and the original Orvar object still exists. That would still pass if the trigger created a token copy of Orvar instead of the targeted land. Please assert the copied object identity directly, e.g. that there are twoForest/target-land copies or one additional land-copy token, and not a second Orvar. -
The Rust lint workflow is failing. The diff also adds a function-local
use crate::types::events::GameEvent;intargeting.rs; imports need to live at module scope in this repo.
Move GameEvent import to module scope, alphabetize the integration test module, and strengthen the regression test to assert a land token copy rather than only a permanent count increase. Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts: # crates/engine/tests/integration/main.rs
matthewevans
left a comment
There was a problem hiding this comment.
Reviewed the updated head after the requested changes. The Orvar fix now binds ParentTarget from the triggering spell’s committed object targets, and the regression discriminates the bug by proving no Orvar token is created while exactly one land token copy is created. I also resolved the current main.rs integration-test mod-line conflict and verified formatting/parser-gate during the merge-forward commit; CI can finish under merge-when-ready.
Summary
ParentTargeton spell-cast triggers from the triggering spell's committed object targets.Test plan
cargo test -p engine --test integration orvarMade with Cursor