- Fixed AI crashing on Verdant Haven.

This commit is contained in:
Sloth
2013-03-14 19:11:45 +00:00
parent 1d6035e66a
commit 592a18cf32

View File

@@ -137,12 +137,15 @@ public class ManaEffect extends SpellAbilityEffect {
abMana.setExpressChoice(choice); abMana.setExpressChoice(choice);
} }
else { else {
if (sa.hasParam("AILogic")) { if (abMana.getExpressChoice().isEmpty()) {
final String logic = sa.getParam("AILogic"); final String logic = sa.hasParam("AILogic") ? sa.getParam("AILogic") : null;
String chosen = Constant.Color.BLACK; String chosen = Constant.Color.BLACK;
if (logic.equals("MostProminentInComputerHand")) { if (logic == null || logic.equals("MostProminentInComputerHand")) {
chosen = ComputerUtilCard.getMostProminentColor(act.getCardsIn(ZoneType.Hand)); chosen = ComputerUtilCard.getMostProminentColor(act.getCardsIn(ZoneType.Hand));
} }
if (chosen.equals("")) {
chosen = Constant.Color.GREEN;
}
GuiChoose.one("Computer picked: ", new String[]{chosen}); GuiChoose.one("Computer picked: ", new String[]{chosen});
abMana.setExpressChoice(MagicColor.toShortString(chosen)); abMana.setExpressChoice(MagicColor.toShortString(chosen));
} }