- Only add existing booster templates to the template map to avoid situations where the game would try to generate a non-existing booster pack and crash (e.g. unlocking a Starter 2000 set in quest mode).

- Only show the "You receive the following bonus cards" window if there are bonus cards available from the booster template.
This commit is contained in:
Agetian
2017-07-13 04:12:53 +00:00
parent 9e65053285
commit 6fdea6572c
2 changed files with 8 additions and 3 deletions

View File

@@ -431,7 +431,9 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
public Map<String, SealedProduct.Template> readAll() {
Map<String, SealedProduct.Template> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
for(CardEdition ce : Collection.this) {
map.put(ce.getCode(), ce.getBoosterTemplate());
if (ce.hasBoosterTemplate()) {
map.put(ce.getCode(), ce.getBoosterTemplate());
}
}
return map;
}

View File

@@ -217,8 +217,11 @@ public class QuestUtilUnlockSets {
cardsWon.addAll(booster.get());
}
qData.getCards().addAllCards(cardsWon);
GuiBase.getInterface().showCardList(unlockedSet.getName(), "You get the following bonus cards:", cardsWon);
if (!cardsWon.isEmpty()) {
qData.getCards().addAllCards(cardsWon);
GuiBase.getInterface().showCardList(unlockedSet.getName(), "You get the following bonus cards:", cardsWon);
}
qData.save();
}
}