mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- 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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user