mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Fixed a bug that prevented moving tokens to other zones in some cases.
This commit is contained in:
parent
445a8a242e
commit
14b2760e99
3 changed files with 78 additions and 3 deletions
|
|
@ -182,9 +182,13 @@ public class CardsImpl extends LinkedHashSet<UUID> implements Cards, Serializabl
|
|||
@Override
|
||||
public Set<Card> getCards(Game game) {
|
||||
Set<Card> cards = new LinkedHashSet<>();
|
||||
for (Iterator<UUID> it = this.iterator(); it.hasNext();) { // Changed to iterator becuase of ConcurrentModificationException
|
||||
for (Iterator<UUID> it = this.iterator(); it.hasNext();) { // Changed to iterator because of ConcurrentModificationException
|
||||
UUID cardId = it.next();
|
||||
|
||||
Card card = game.getCard(cardId);
|
||||
if (card == null) {
|
||||
card = game.getPermanent(cardId); // needed to get TokenCard objects
|
||||
}
|
||||
if (card != null) { // this can happen during the cancelation (player concedes) of a game
|
||||
cards.add(card);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue