*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:
Hellfish
2011-10-21 08:49:44 +00:00
parent f275ce0e4b
commit bca99199e4

View File

@@ -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;