mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
*Fixed AF_NameCard crashing if the named card didn't exist or wasn't implemented. Now it will simply ask again. It is,sadly, still case sensitive.
This commit is contained in:
@@ -1286,11 +1286,16 @@ public class AbilityFactory_Choose {
|
|||||||
String name = null;
|
String name = null;
|
||||||
while (!ok) {
|
while (!ok) {
|
||||||
if (sa.getActivatingPlayer().isHuman()) {
|
if (sa.getActivatingPlayer().isHuman()) {
|
||||||
String message = validDesc.equals("card") ? "Name a card" : "Name a " + validDesc + " card";
|
String message = validDesc.equals("card") ? "Name a card" : "Name a " + validDesc + " card. (Case sensitive)";
|
||||||
name = JOptionPane.showInputDialog(null, message, host.getName(), JOptionPane.QUESTION_MESSAGE);
|
name = JOptionPane.showInputDialog(null, message, host.getName(), JOptionPane.QUESTION_MESSAGE);
|
||||||
if (!valid.equals("Card") && !(null == name)) {
|
if (!valid.equals("Card") && !(null == name)) {
|
||||||
|
try {
|
||||||
Card temp = AllZone.getCardFactory().getCard(name, p);
|
Card temp = AllZone.getCardFactory().getCard(name, p);
|
||||||
ok = temp.isValid(valid, host.getController(), host);
|
ok = temp.isValid(valid, host.getController(), host);
|
||||||
|
}
|
||||||
|
catch(Exception ignored) {
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ok = true;
|
ok = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user