mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
fix precon loading issues
This commit is contained in:
@@ -88,8 +88,11 @@ public final class CardDb implements ICardDatabase {
|
|||||||
|
|
||||||
String[] nameParts = TextUtil.split(name, NameSetSeparator);
|
String[] nameParts = TextUtil.split(name, NameSetSeparator);
|
||||||
|
|
||||||
int setPos = nameParts.length >= 2 && !StringUtils.isNumeric(nameParts[1]) ? 1 : -1;
|
boolean hasSet = nameParts.length > 1 && nameParts[1].length() >= 2;
|
||||||
int artPos = nameParts.length >= 2 && StringUtils.isNumeric(nameParts[1]) ? 1 : nameParts.length >= 3 && StringUtils.isNumeric(nameParts[2]) ? 2 : -1;
|
int setPos = hasSet ? 1 : -1;
|
||||||
|
int artPos = hasSet ? 2 : 1;
|
||||||
|
if( nameParts.length <= artPos || StringUtils.isNumeric(nameParts[artPos]))
|
||||||
|
artPos = -1;
|
||||||
|
|
||||||
String cardName = nameParts[0];
|
String cardName = nameParts[0];
|
||||||
if( cardName.endsWith(foilSuffix)) {
|
if( cardName.endsWith(foilSuffix)) {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import java.util.regex.Pattern;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import forge.StaticData;
|
import forge.StaticData;
|
||||||
|
import forge.card.CardDb;
|
||||||
import forge.item.PaperCard;
|
import forge.item.PaperCard;
|
||||||
import forge.util.ItemPool;
|
import forge.util.ItemPool;
|
||||||
import forge.util.MyRandom;
|
import forge.util.MyRandom;
|
||||||
@@ -66,7 +67,7 @@ public class CardPool extends ItemPool<PaperCard> {
|
|||||||
if (cp == null )
|
if (cp == null )
|
||||||
throw new RuntimeException(String.format("Card %s from %s is not supported by Forge, as it's neither a known common card nor one of casual variants' card.", cardName, setCode ));
|
throw new RuntimeException(String.format("Card %s from %s is not supported by Forge, as it's neither a known common card nor one of casual variants' card.", cardName, setCode ));
|
||||||
|
|
||||||
boolean artIndexExplicitlySet = artIndex > 0 || Character.isDigit(cardName.charAt(cardName.length()-1));
|
boolean artIndexExplicitlySet = artIndex > 0 || Character.isDigit(cardName.charAt(cardName.length()-1)) && cardName.charAt(cardName.length()-2) == CardDb.NameSetSeparator;
|
||||||
setCode = cp.getEdition();
|
setCode = cp.getEdition();
|
||||||
cardName = cp.getName();
|
cardName = cp.getName();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user