Merge branch 'etali' into 'master'

PlayEffect: Fix loop of selecting same card when optional

Closes #1835

See merge request core-developers/forge!4697
This commit is contained in:
Michael Kamensky
2021-05-16 03:47:07 +00:00

View File

@@ -180,8 +180,7 @@ public class PlayEffect extends SpellAbilityEffect {
activator.addController(controlledByTimeStamp, controlledByPlayer);
}
final CardCollection saidNoTo = new CardCollection();
while (tgtCards.size() > saidNoTo.size() && saidNoTo.size() < amount && amount > 0) {
while (!tgtCards.isEmpty() && amount > 0) {
activator.getController().tempShowCards(showCards);
Card tgtCard = controller.getController().chooseSingleEntityForEffect(tgtCards, sa, Localizer.getInstance().getMessage("lblSelectCardToPlay"), null);
activator.getController().endTempShowCards();
@@ -207,7 +206,7 @@ public class PlayEffect extends SpellAbilityEffect {
if (wasFaceDown) {
tgtCard.turnFaceDownNoUpdate();
}
saidNoTo.add(tgtCard);
tgtCards.remove(tgtCard);
continue;
}
@@ -241,7 +240,7 @@ public class PlayEffect extends SpellAbilityEffect {
source.addRemembered(tgtCard);
}
} else {
saidNoTo.add(tgtCard);
tgtCards.remove(tgtCard);
}
continue;
}