- Fixed the Glasses of Urza bug which occurs when trying to display the cards when the target player's hand is empty.

This commit is contained in:
jendave
2011-08-06 05:56:13 +00:00
parent b945c24d67
commit 24e133392d

View File

@@ -21438,27 +21438,33 @@ public class CardFactory implements NewConstants {
card.addSpellAbility(ability); card.addSpellAbility(ability);
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************
else if(cardName.equals("Glasses of Urza")) { else if(cardName.equals("Glasses of Urza")) {
final Ability_Tap ability = new Ability_Tap(card, "0") { final Ability_Tap ability = new Ability_Tap(card, "0") {
private static final long serialVersionUID = -3857979945891501990L; private static final long serialVersionUID = -3857979945891501990L;
@Override @Override
public void resolve() { public void resolve() {
final String player = getTargetPlayer(); final String player = getTargetPlayer();
CardList hand = AllZoneUtil.getPlayerHand(player); CardList hand = AllZoneUtil.getPlayerHand(player);
AllZone.Display.getChoice("Target player's hand", hand.toArray()); if (hand.size() > 0) {
} AllZone.Display.getChoice("Target player's hand", hand.toArray());
} else {
StringBuffer sb = new StringBuffer();
sb.append(getTargetPlayer()).append("'s hand is empty!");
javax.swing.JOptionPane.showMessageDialog(null, sb.toString(), "Target player's hand", JOptionPane.INFORMATION_MESSAGE);
}
}//resolve()
@Override @Override
public boolean canPlayAI() { public boolean canPlayAI() {
return false; return false;
} }
};//SpellAbility };//SpellAbility
ability.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability)); ability.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability));
card.addSpellAbility(ability); card.addSpellAbility(ability);
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************