* Move cards from battlefield - fixed that some abilities can duplicates moving cards For devs: all cards with CardsImpl and moveCards calls like Winds of Abandon;
-
package mage.cards;
-import java.io.Serializable;
-import java.util.*;
-import java.util.stream.Collectors;
import mage.MageObject;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.util.RandomUtil;
import mage.util.ThreadLocalStringBuilder;
+import java.io.Serializable;
+import java.util.*;
+import java.util.stream.Collectors;
+
/**
* @author BetaSteward_at_googlemail.com
*/
@@ -138,10 +138,12 @@ public class CardsImpl extends LinkedHashSet<UUID> implements Cards, Serializabl
for (Iterator<UUID> it = this.iterator(); it.hasNext(); ) { // Changed to iterator because of ConcurrentModificationException
UUID cardId = it.next();
- Card card = game.getCard(cardId);
+ // cards from battlefield must be as permanent, not card (moveCards uses instanceOf Permanent)
+ Card card = game.getPermanent(cardId);
if (card == null) {
- card = game.getPermanent(cardId); // needed to get TokenCard objects
+ card = game.getCard(cardId);
}
+
if (card != null) { // this can happen during the cancelation (player concedes) of a game
cards.add(card);
}
