Fixed that by some effects that move permanents from battlefield to other zones, the object was not moved and was still on the battlefield but also shown in the target zone.

This commit is contained in:
LevelX2 2015-06-14 18:39:01 +02:00
parent f6ef6f6667
commit 35654a5ca8

View file

@ -2839,7 +2839,19 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override @Override
public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) { public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) {
ArrayList<Card> cardList = new ArrayList<>(); ArrayList<Card> cardList = new ArrayList<>();
cardList.addAll(cards.getCards(game)); for (UUID cardId: cards) {
if (fromZone.equals(Zone.BATTLEFIELD)) {
Permanent permanent = game.getPermanent(cardId);
if (permanent != null) {
cardList.add(permanent);
}
} else {
Card card = game.getCard(cardId);
if (card != null) {
cardList.add(card);
}
}
}
return moveCards(cardList, fromZone, toZone, source, game); return moveCards(cardList, fromZone, toZone, source, game);
} }