From 344fab998ea27c4dba3fcf5ec4c34a3ca1f195cc Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 10:53:00 +0000 Subject: [PATCH] check for valid targets in resolve for The Abyss. --- src/forge/GameActionUtil.java | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index ab6d51a65c0..b296e36dfd2 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -3609,21 +3609,23 @@ public class GameActionUtil { @Override public void resolve() { if(player.equals(AllZone.HumanPlayer)) { - AllZone.InputControl.setInput( new Input() { - private static final long serialVersionUID = 4820011040853968644L; - public void showMessage() { - AllZone.Display.showMessage(abyss.getName()+" - Select one nonartifact creature to destroy"); - ButtonUtil.disableAll(); - } - public void selectCard(Card selected, PlayerZone zone) { - //probably need to restrict by controller also - if(selected.isCreature() && !selected.isArtifact() && CardFactoryUtil.canTarget(abyss, selected) - && zone.is(Constant.Zone.Play) && zone.getPlayer().equals(AllZone.HumanPlayer)) { - AllZone.GameAction.destroyNoRegeneration(selected); - stop(); + if(abyss_getTargets(player, abyss).size() > 0) { + AllZone.InputControl.setInput( new Input() { + private static final long serialVersionUID = 4820011040853968644L; + public void showMessage() { + AllZone.Display.showMessage(abyss.getName()+" - Select one nonartifact creature to destroy"); + ButtonUtil.disableAll(); } - }//selectCard() - });//Input + public void selectCard(Card selected, PlayerZone zone) { + //probably need to restrict by controller also + if(selected.isCreature() && !selected.isArtifact() && CardFactoryUtil.canTarget(abyss, selected) + && zone.is(Constant.Zone.Play) && zone.getPlayer().equals(AllZone.HumanPlayer)) { + AllZone.GameAction.destroyNoRegeneration(selected); + stop(); + } + }//selectCard() + });//Input + } } else { //computer CardList targets = abyss_getTargets(player,abyss);