mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Fixed a crash when loading a game state with a misspelled card name (will now report the card name in the console instead of hard-crashing).
This commit is contained in:
@@ -510,6 +510,11 @@ public abstract class GameState {
|
||||
c = CardFactory.makeOneToken(CardFactory.TokenInfo.fromString(tokenStr), player);
|
||||
} else {
|
||||
PaperCard pc = StaticData.instance().getCommonCards().getCard(cardinfo[0], setCode);
|
||||
if (pc == null) {
|
||||
System.err.println("ERROR: Tried to create a non-existent card named " + cardinfo[0] + " (set: " + (setCode == null ? "any" : setCode) + ") when loading game state!");
|
||||
continue;
|
||||
}
|
||||
|
||||
c = Card.fromPaperCard(pc, player);
|
||||
if (setCode != null) {
|
||||
hasSetCurSet = true;
|
||||
|
||||
Reference in New Issue
Block a user