Give a stolen card back when a snapshot is restored - #11422
Conversation
Nothing in GameSnapshot restores who controls a card, so a creature that changed hands after the snapshot was taken stays with its new controller when the state is put back. Reported from play: casting Claim the Firstborn and then rolling back returned the spell to hand and left the creature on the thief's side. The zone handling missed it as well. A card already in the game is only taken out of its current zone when the zone type differs, and moving between two players' battlefields keeps the type — so the creature was added to the owner's battlefield while remaining in the thief's, ending up in both. Restore the controller alongside the rest of the card state, and take the card out of whatever zone it currently sits in unless that is already the zone it is going into. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Closing this in favour of #10294, which already restores the controller as part of its wider pass over the snapshot state. One piece of this PR is not in #10294, so I do not want it to get lost: a card already in the game is only removed from its current zone when the zone type differs, and a move between two players' battlefields keeps the type. A stolen creature therefore ends up in both battlefields at once, independently of who the card names as controller. If that is worth having on its own I am happy to open it as a separate one-hunk PR. Found while playing: cast Claim the Firstborn, roll back, creature stays on the thief's side. |
|
seems relevant enough so we can just discuss it here, that's way easier than on some already too complex other one:
|
|
Sorry for the slow reply, and thanks for looking at it. I'm off Forge for the time being — my time is going elsewhere — so I'd rather hand this back than leave it sitting in your queue. Worth flagging: #10294 is closed now. I withdrew this PR and #11420 in its favour, so both pieces are unowned again — the zone hunk here, and the one-line foretold restore in #11420. On the controller question: you're right to doubt it. I can't check it properly without going back into the code, so treat that hunk as unverified rather than take my word for it. Closing this. The zone part is one change and reproduces with Claim the Firstborn plus a rollback, if anyone wants to pick it up. |
Problem
Nothing in
GameSnapshotrestores who controls a card. A creature that changed hands after the snapshot was taken stays with its new controller when the state is put back.Reported from play: cast Claim the Firstborn, then roll back. The spell returns to hand, the creature stays on the thief's side.
The zone handling misses it too:
A card already in the game is only taken out of its current zone when the zone type differs — and a move between two players' battlefields keeps the type. So the creature is added to the owner's battlefield while remaining in the thief's, ending up in both at once.
Fix
Restore the controller alongside the rest of the card state, and take the card out of whatever zone it currently sits in unless that is already the zone it is going into.
Reproduction
Snapshot with a creature under its owner's control, give control to the opponent with a zone correction, restore: before the change control stays with the opponent and the creature is in both battlefields; after it, the creature is back under its owner with a single copy on the board.
Notes
AI disclosure
Written with Claude Code (Claude Opus 5), as requested in CONTRIBUTING; the agent is also recorded as co-author on the commit.