mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +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() {
|
public Map<String, SealedProduct.Template> readAll() {
|
||||||
Map<String, SealedProduct.Template> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
Map<String, SealedProduct.Template> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
||||||
for(CardEdition ce : Collection.this) {
|
for(CardEdition ce : Collection.this) {
|
||||||
map.put(ce.getCode(), ce.getBoosterTemplate());
|
if (ce.hasBoosterTemplate()) {
|
||||||
|
map.put(ce.getCode(), ce.getBoosterTemplate());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,8 +217,11 @@ public class QuestUtilUnlockSets {
|
|||||||
cardsWon.addAll(booster.get());
|
cardsWon.addAll(booster.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
qData.getCards().addAllCards(cardsWon);
|
if (!cardsWon.isEmpty()) {
|
||||||
GuiBase.getInterface().showCardList(unlockedSet.getName(), "You get the following bonus cards:", cardsWon);
|
qData.getCards().addAllCards(cardsWon);
|
||||||
|
GuiBase.getInterface().showCardList(unlockedSet.getName(), "You get the following bonus cards:", cardsWon);
|
||||||
|
}
|
||||||
|
|
||||||
qData.save();
|
qData.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user