mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Better fix for BoosterGenerator NPE
This commit is contained in:
@@ -61,9 +61,9 @@ public class BoosterGenerator {
|
|||||||
List<PrintSheet> sheetsUsed = new ArrayList<PrintSheet>();
|
List<PrintSheet> sheetsUsed = new ArrayList<PrintSheet>();
|
||||||
|
|
||||||
CardEdition edition = StaticData.instance().getEditions().get(template.getEdition());
|
CardEdition edition = StaticData.instance().getEditions().get(template.getEdition());
|
||||||
boolean hasFoil = edition != null && MyRandom.getRandom().nextDouble() < edition.getFoilChanceInBooster() && edition.getFoilType() != FoilType.NOT_SUPPORTED;
|
boolean hasFoil = edition != null && !template.getSlots().isEmpty() && MyRandom.getRandom().nextDouble() < edition.getFoilChanceInBooster() && edition.getFoilType() != FoilType.NOT_SUPPORTED;
|
||||||
boolean foilAtEndOfPack = hasFoil && edition.getFoilAlwaysInCommonSlot();
|
boolean foilAtEndOfPack = hasFoil && edition.getFoilAlwaysInCommonSlot();
|
||||||
String foilSlot = (template.getSlots().isEmpty() || !hasFoil) ? null : foilAtEndOfPack ? BoosterSlots.COMMON : Aggregates.random(template.getSlots()).getKey();
|
String foilSlot = !hasFoil ? null : foilAtEndOfPack ? BoosterSlots.COMMON : Aggregates.random(template.getSlots()).getKey();
|
||||||
|
|
||||||
for(Pair<String, Integer> slot : template.getSlots()) {
|
for(Pair<String, Integer> slot : template.getSlots()) {
|
||||||
String slotType = slot.getLeft(); // add expansion symbol here?
|
String slotType = slot.getLeft(); // add expansion symbol here?
|
||||||
|
|||||||
Reference in New Issue
Block a user