Skip to content

Commit

Permalink
Fix UntilHostLeavesPlay being dropped when replaced (#4502)
Browse files Browse the repository at this point in the history
  • Loading branch information
tool4ever authored Jan 14, 2024
1 parent b610036 commit f19cc05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion forge-game/src/main/java/forge/game/card/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {

private Map<Long, Player> goad = Maps.newTreeMap();

private final List<GameCommand> leavePlayCommandList = Lists.newArrayList();
private List<GameCommand> leavePlayCommandList = Lists.newArrayList();
private final List<GameCommand> untapCommandList = Lists.newArrayList();
private final List<GameCommand> changeControllerCommandList = Lists.newArrayList();
private final List<GameCommand> unattachCommandList = Lists.newArrayList();
Expand Down Expand Up @@ -3397,6 +3397,13 @@ public final void addChangeControllerCommand(final GameCommand c) {
changeControllerCommandList.add(c);
}

public final List<GameCommand> getLeavesPlayCommands() {
return leavePlayCommandList;
}
public final void setLeavesPlayCommands(List<GameCommand> list) {
leavePlayCommandList = list;
}

public final void runLeavesPlayCommands() {
for (final GameCommand c : leavePlayCommandList) {
c.run();
Expand Down
1 change: 1 addition & 0 deletions forge-game/src/main/java/forge/game/card/CardFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public final static Card copyCard(final Card in, boolean assignNewId) {
// this's necessary for forge.game.GameAction.unattachCardLeavingBattlefield(Card)
out.setAttachedCards(in.getAttachedCards());
out.setEntityAttachedTo(in.getEntityAttachedTo());
out.setLeavesPlayCommands(in.getLeavesPlayCommands());

out.setSpecialized(in.isSpecialized());
out.addRemembered(in.getRemembered());
Expand Down

0 comments on commit f19cc05

Please sign in to comment.