From 68fcb019ae2d21f30fc4a3df09946632d91c163d Mon Sep 17 00:00:00 2001 From: Maxmtg Date: Fri, 26 Apr 2013 03:07:14 +0000 Subject: [PATCH] fix booster generation for quest modes --- src/main/java/forge/card/BoosterGenerator.java | 4 ++-- src/main/java/forge/quest/QuestUtilCards.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/forge/card/BoosterGenerator.java b/src/main/java/forge/card/BoosterGenerator.java index 04468116aa0..1faa36ddad6 100644 --- a/src/main/java/forge/card/BoosterGenerator.java +++ b/src/main/java/forge/card/BoosterGenerator.java @@ -61,7 +61,7 @@ public class BoosterGenerator { int numCards = slot.getRight().intValue(); String[] sType = TextUtil.splitWithParenthesis(slotType, ' ', '(', ')'); - String sheetKey = sType.length == 1 ? slotType.trim() + " " + booster.getEdition() : slotType.trim(); + String sheetKey = sType.length == 1 && booster.getEdition() != null ? slotType.trim() + " " + booster.getEdition() : slotType.trim(); PrintSheet ps = getPrintSheet(sheetKey); result.addAll(ps.random(numCards, true)); @@ -167,7 +167,7 @@ public class BoosterGenerator { * @return */ private static Predicate buildExtraPredicate(String[] operators) { - if ( operators.length == 0) + if ( operators.length <= 1) return Predicates.alwaysTrue(); List> conditions = new ArrayList>(); diff --git a/src/main/java/forge/quest/QuestUtilCards.java b/src/main/java/forge/quest/QuestUtilCards.java index 1c6339af994..8fa7c73473b 100644 --- a/src/main/java/forge/quest/QuestUtilCards.java +++ b/src/main/java/forge/quest/QuestUtilCards.java @@ -453,7 +453,7 @@ public final class QuestUtilCards { * @param count * the count */ - public void generateBoostersInShop(final int count) { + private void generateBoostersInShop(final int count) { for (int i = 0; i < count; i++) { final int rollD100 = MyRandom.getRandom().nextInt(100); Predicate filter = rollD100 < 40 ? this.filterT2booster @@ -472,7 +472,7 @@ public final class QuestUtilCards { * @param count * the count */ - public void generateTournamentsInShop(final int count) { + private void generateTournamentsInShop(final int count) { Predicate formatFilter = CardEdition.Predicates.HAS_TOURNAMENT_PACK; if (qc.getFormat() != null) { formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat())); @@ -487,7 +487,7 @@ public final class QuestUtilCards { * @param count * the count */ - public void generateFatPacksInShop(final int count) { + private void generateFatPacksInShop(final int count) { Predicate formatFilter = CardEdition.Predicates.HAS_FAT_PACK; if (qc.getFormat() != null) { formatFilter = Predicates.and(formatFilter, isLegalInQuestFormat(qc.getFormat())); @@ -502,7 +502,7 @@ public final class QuestUtilCards { * @param count * the count */ - public void generatePreconsInShop(final int count) { + private void generatePreconsInShop(final int count) { final List meetRequirements = new ArrayList(); for (final PreconDeck deck : QuestController.getPrecons()) { if (deck.getRecommendedDeals().meetsRequiremnts(this.qc.getAchievements()) &&