mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Add infinite loop protection for Stonehewer
This commit is contained in:
@@ -101,15 +101,15 @@ public class CopyPermanentEffect extends TokenEffectBase {
|
||||
List<Card> choice = Lists.newArrayList();
|
||||
final String num = sa.hasParam("RandomNum") ? sa.getParam("RandomNum") : "1";
|
||||
int ncopied = AbilityUtils.calculateAmount(host, num, sa);
|
||||
while(ncopied > 0) {
|
||||
while(ncopied > 0 && !copysource.isEmpty()) {
|
||||
final PaperCard cp = Aggregates.random(copysource);
|
||||
Card possibleCard = Card.fromPaperCard(cp, activator); // Need to temporarily set the Owner so the Game is set
|
||||
|
||||
if (possibleCard.isValid(valid, host.getController(), host, sa)) {
|
||||
choice.add(possibleCard);
|
||||
copysource.remove(cp);
|
||||
ncopied -= 1;
|
||||
}
|
||||
copysource.remove(cp);
|
||||
}
|
||||
tgtCards = choice;
|
||||
} else if (sa.hasParam("DefinedName")) {
|
||||
|
||||
Reference in New Issue
Block a user