Skip to content

Restore the foretold state when a snapshot is restored - #11420

Closed
cuinhellcat wants to merge 1 commit into
Card-Forge:masterfrom
cuinhellcat:foretell-snapshot-fix
Closed

Restore the foretold state when a snapshot is restored#11420
cuinhellcat wants to merge 1 commit into
Card-Forge:masterfrom
cuinhellcat:foretell-snapshot-fix

Conversation

@cuinhellcat

Copy link
Copy Markdown

Fixes #7844.

Problem

Cancel the cast of a foretold card and it comes back to exile without its foretold state, so it can no longer be cast with Foretell.

setCardInCopiedGame restores a card's tapped, face-down, manifested, sickness and state-name, but the two lines for the foretold flags are commented out:

newCard.setSickness(fromCard.hasSickness());
//newCard.setForetold(fromCard.isForetold());
//newCard.setForetoldCostByEffect(fromCard.isForetoldCostByEffect());
newCard.setState(fromCard.getCurrentStateName(), false);

They have been comments since the method was introduced in "Trying to fix gateway dialog glitching" — never active, so this is not re-enabling something that was switched off for a reason. Nothing else restores that state, while CardCopyService.copyCard already carries both flags into the snapshot, so the information is there and simply not read back.

Reproduction

Take a snapshot with a face-down foretold card in exile, turn it face up onto the stack the way casting does, restore. The card returns to exile face down, and isForetold() is false.

Notes

  • isForetold() reads the field for a card in exile and derives it from the cast ability elsewhere, so setForetold(fromCard.isForetold()) restores the value that matters and is a no-op for cards that are not in exile.
  • No test added, per the note in CONTRIBUTING about agent-added tests. I have one that fails before the change and passes after (the reproduction above); happy to include it if you want it.
  • Forge's desktop suite (278 tests) passes with the change.

AI disclosure

Written with Claude Code (Claude Opus 5), as requested in CONTRIBUTING; the agent is also recorded as co-author on the commit.

Cancelling the cast of a foretold card left it in exile without its
foretold flag, so it could no longer be cast with Foretell. The two
setters for that state have sat commented out in setCardInCopiedGame
since the method was introduced; nothing else restores them, and
CardCopyService already carries the flags into the snapshot itself.

Reproduced by taking a snapshot of a face-down foretold card in exile,
turning it face up onto the stack as casting does, and restoring: zone
and face-down state come back, isForetold() does not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cuinhellcat

Copy link
Copy Markdown
Author

Closing this in favour of #10294, which already restores the foretold flags as part of its wider pass over the snapshot state. No point spending review time on the same two lines twice.

If #10294 does not move, this is a one-line change to bring back — say the word and I will reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: cancelled foretell card is no longer foretold

1 participant