mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
fix crash when card defined is missing or invalid
these card should be replaced or create a custom card for adventure mode Power Struggle, Necropolis of Azar
This commit is contained in:
@@ -48,9 +48,14 @@ public class EffectData implements Serializable {
|
|||||||
if(C != null)
|
if(C != null)
|
||||||
startCards.add(C);
|
startCards.add(C);
|
||||||
else {
|
else {
|
||||||
PaperToken T = FModel.getMagicDb().getAllTokens().getToken(name);
|
try {
|
||||||
if (T != null) startCards.add(T);
|
PaperToken T = FModel.getMagicDb().getAllTokens().getToken(name);
|
||||||
else System.err.print("Can not find card \"" + name + "\"\n");
|
if (T != null) startCards.add(T);
|
||||||
|
else System.err.print("Can not find card/token \"" + name + "\"\n");
|
||||||
|
} catch (Exception e) {
|
||||||
|
//if it's not found probably the item is using funny cards and the users setting disabled non legal cards
|
||||||
|
System.err.print("Can not find card/token \"" + name + "\"\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,9 +70,14 @@ public class EffectData implements Serializable {
|
|||||||
if(C != null)
|
if(C != null)
|
||||||
startCardsInCommandZone.add(C);
|
startCardsInCommandZone.add(C);
|
||||||
else {
|
else {
|
||||||
PaperToken T = FModel.getMagicDb().getAllTokens().getToken(name);
|
try {
|
||||||
if (T != null) startCardsInCommandZone.add(T);
|
PaperToken T = FModel.getMagicDb().getAllTokens().getToken(name);
|
||||||
else System.err.print("Can not find card \"" + name + "\"\n");
|
if (T != null) startCardsInCommandZone.add(T);
|
||||||
|
else System.err.print("Can not find card/token \"" + name + "\"\n");
|
||||||
|
} catch (Exception e) {
|
||||||
|
//if it's not found probably the item is using funny cards and the users setting disabled non legal cards
|
||||||
|
System.err.print("Can not find card/token \"" + name + "\"\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user