* Fixed some problems with getting cards at random from collection that could cause loops.

This commit is contained in:
LevelX2 2018-02-04 12:27:08 +01:00
parent 5fa20278b0
commit 4dd196f373
20 changed files with 134 additions and 160 deletions

View file

@ -177,18 +177,7 @@ public class LookLibraryControllerEffect extends OneShotEffect {
switch (targetZoneLookedCards) {
case LIBRARY:
if (putOnTop) {
player.putCardsOnTopOfLibrary(cards, game, source, true);
} else {
if (backInRandomOrder) {
Cards newOrder = new CardsImpl();
while (!cards.isEmpty()) {
Card card = cards.getRandom(game);
newOrder.add(card);
cards.remove(card);
}
cards = newOrder;
}
player.putCardsOnBottomOfLibrary(cards, game, source, true);
player.putCardsOnBottomOfLibrary(cards, game, source, !backInRandomOrder);
}
break;
case GRAVEYARD: