mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed bug #187 were targets in graveyard got illegal (happens only in games vs. AI). Bug was caused by zoneChangeCounter increased by AI simulation.
This commit is contained in:
parent
6a4a3923a6
commit
d473796373
3 changed files with 7 additions and 6 deletions
|
@ -62,7 +62,7 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect<ReturnF
|
|||
if (card != null) {
|
||||
Player player = game.getPlayer(card.getOwnerId());
|
||||
if (player != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
secondSideCard = card.secondSideCard;
|
||||
nightCard = card.nightCard;
|
||||
}
|
||||
|
||||
zoneChangeCounter = card.zoneChangeCounter;
|
||||
if (card.info != null) {
|
||||
info = new HashMap<String, String>();
|
||||
info.putAll(card.info);
|
||||
|
|
|
@ -173,10 +173,11 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
this.attackOption = game.attackOption;
|
||||
this.state = game.state.copy();
|
||||
// Issue 350
|
||||
this.gameCards = game.gameCards;
|
||||
// for (Map.Entry<UUID, Card> 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<UUID, Card> 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);
|
||||
|
|
Loading…
Reference in a new issue