From d4737963731a8c73c424fa91dabf2994c082a209 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 6 Apr 2013 16:53:51 +0200 Subject: [PATCH] Fixed bug #187 were targets in graveyard got illegal (happens only in games vs. AI). Bug was caused by zoneChangeCounter increased by AI simulation. --- .../common/ReturnFromGraveyardToHandTargetEffect.java | 2 +- Mage/src/mage/cards/CardImpl.java | 2 +- Mage/src/mage/game/GameImpl.java | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java index 394b1056d6..7543f8a0e5 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java @@ -62,7 +62,7 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect> extends MageObjectImpl secondSideCard = card.secondSideCard; nightCard = card.nightCard; } - + zoneChangeCounter = card.zoneChangeCounter; if (card.info != null) { info = new HashMap(); info.putAll(card.info); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 75c220052a..a008247657 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -173,10 +173,11 @@ public abstract class GameImpl> implements Game, Serializa this.attackOption = game.attackOption; this.state = game.state.copy(); // Issue 350 - this.gameCards = game.gameCards; -// for (Map.Entry entry: game.gameCards.entrySet()) { -// this.gameCards.put(entry.getKey(), entry.getValue().copy()); -// } +// this.gameCards = game.gameCards; + // issue #187 (else zoneChangeCounter modified by AI -> illegal target) + for (Map.Entry entry: game.gameCards.entrySet()) { + this.gameCards.put(entry.getKey(), entry.getValue().copy()); + } this.simulation = game.simulation; this.gameOptions = game.gameOptions; this.lki.putAll(game.lki);