- Don't crash for ante if only basic lands are found

This commit is contained in:
Sol
2013-05-11 17:53:32 +00:00
parent 6f4b2312fd
commit 7f2d1e49f9

View File

@@ -301,7 +301,8 @@ public class GameNew {
Predicate<Card> goodForAnte = Predicates.not(CardPredicates.Presets.BASIC_LANDS);
Card ante = Aggregates.random(Iterables.filter(lib, goodForAnte));
if (ante == null) {
throw new RuntimeException(p + " library is empty.");
game.getGameLog().add("Ante", "Only basic lands found. Will ante one of them", 0);
ante = Aggregates.random(lib);
}
game.getGameLog().add("Ante", p + " anted " + ante, 0);
game.getAction().moveTo(ZoneType.Ante, ante);