* 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

@ -321,8 +321,11 @@ public class RandomPlayer extends ComputerPlayer {
return !target.isRequired(source);
}
Card card = cards.getRandom(game);
target.addTarget(card.getId(), source, game);
return true;
if (card != null) {
target.addTarget(card.getId(), source, game);
return true;
}
return false;
}
@Override