mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Fix more places to load cards lazily correctly.
This commit is contained in:
@@ -185,19 +185,11 @@ public class GauntletIO {
|
||||
final String sIndex = reader.getAttribute("i");
|
||||
final short index = StringUtils.isNumeric(sIndex) ? Short.parseShort(sIndex) : 0;
|
||||
final boolean foil = "1".equals(reader.getAttribute("foil"));
|
||||
PaperCard card = FModel.getMagicDb().getCommonCards().getCard(name, set, index);
|
||||
if (null == card) {
|
||||
FModel.getMagicDb().attemptToLoadCard(name, set);
|
||||
card = FModel.getMagicDb().getCommonCards().getCard(name, set, index);
|
||||
}
|
||||
if (null == card) {
|
||||
FModel.getMagicDb().attemptToLoadCard(name, set);
|
||||
card = FModel.getMagicDb().getCommonCards().getCard(name, set, -1);
|
||||
}
|
||||
PaperCard card = FModel.getMagicDb().getOrLoadCommonCard(name, set, index, foil);
|
||||
if (null == card) {
|
||||
throw new RuntimeException("Unsupported card found in quest save: " + name + " from edition " + set);
|
||||
}
|
||||
return foil ? FModel.getMagicDb().getCommonCards().getFoiled(card) : card;
|
||||
return card;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,9 +897,11 @@ public class QuestDataIO {
|
||||
final String sIndex = reader.getAttribute("i");
|
||||
final short index = StringUtils.isNumeric(sIndex) ? Short.parseShort(sIndex) : 0;
|
||||
final boolean foil = "1".equals(reader.getAttribute("foil"));
|
||||
PaperCard c = FModel.getMagicDb().getCommonCards().getCard(name, set, index);
|
||||
if ( null == c ) c = FModel.getMagicDb().getCommonCards().getCard(name);
|
||||
return foil ? FModel.getMagicDb().getCommonCards().getFoiled(c) : c;
|
||||
PaperCard card = FModel.getMagicDb().getOrLoadCommonCard(name, set, index, foil);
|
||||
if (null == card) {
|
||||
throw new RuntimeException("Unsupported card found in quest save: " + name + " from edition " + set);
|
||||
}
|
||||
return card;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,14 +177,11 @@ public class TournamentIO {
|
||||
final String sIndex = reader.getAttribute("i");
|
||||
final short index = StringUtils.isNumeric(sIndex) ? Short.parseShort(sIndex) : 0;
|
||||
final boolean foil = "1".equals(reader.getAttribute("foil"));
|
||||
PaperCard card = FModel.getMagicDb().getCommonCards().getCard(name, set, index);
|
||||
if (null == card) {
|
||||
card = FModel.getMagicDb().getCommonCards().getCard(name, set, -1);
|
||||
}
|
||||
PaperCard card = FModel.getMagicDb().getOrLoadCommonCard(name, set, index, foil);
|
||||
if (null == card) {
|
||||
throw new RuntimeException("Unsupported card found in quest save: " + name + " from edition " + set);
|
||||
}
|
||||
return foil ? FModel.getMagicDb().getCommonCards().getFoiled(card) : card;
|
||||
return card;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user