Skip to content

Commit

Permalink
Fix GameStates starting with frozen stack if RE executes (#6213)
Browse files Browse the repository at this point in the history
* Fix GameStates starting with frozen stack if RE executes

* Fix NPE when facedown
  • Loading branch information
tool4ever authored Sep 29, 2024
1 parent ea070a8 commit a949a98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions forge-ai/src/main/java/forge/ai/GameState.java
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ protected void applyGameOnThread(final Game game) {
}

game.getStack().setResolving(false);
game.getStack().unfreezeStack();

// Advance to a certain phase, activating all triggered abilities
if (advPhase != null) {
Expand Down
5 changes: 3 additions & 2 deletions forge-game/src/main/java/forge/game/card/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -2482,8 +2482,9 @@ public final String keywordsToText(final Collection<KeywordInterface> keywords)
sbLong.append(" (").append(inst.getReminderText()).append(")");
} else if (keyword.equals("Gift")) {
sbLong.append(keyword);
if (inst.getHostCard() != null && inst.getHostCard().getFirstSpellAbility().hasAdditionalAbility("GiftAbility")) {
sbLong.append(" ").append(inst.getHostCard().getFirstSpellAbility().getAdditionalAbility("GiftAbility").getParam("GiftDescription"));
Trigger trig = inst.getTriggers().stream().findFirst().orElse(null);
if (trig != null && trig.getCardState().getFirstSpellAbility().hasAdditionalAbility("GiftAbility")) {
sbLong.append(" ").append(trig.getCardState().getFirstSpellAbility().getAdditionalAbility("GiftAbility").getParam("GiftDescription"));
}
sbLong.append("\r\n");
} else if (keyword.startsWith("Starting intensity")) {
Expand Down

0 comments on commit a949a98

Please sign in to comment.