diff --git a/forge-gui/src/main/java/forge/card/spellability/Ability.java b/forge-gui/src/main/java/forge/card/spellability/Ability.java index 8f818ff51ce..efcdf19fb03 100644 --- a/forge-gui/src/main/java/forge/card/spellability/Ability.java +++ b/forge-gui/src/main/java/forge/card/spellability/Ability.java @@ -80,9 +80,12 @@ public abstract class Ability extends SpellAbility { } public static final Ability PLAY_LAND_SURROGATE = new Ability(null, (Cost)null){ + @Override + public boolean canPlay() { + return true; //if this ability is added anywhere, it can be assummed that land can be played + } @Override public void resolve() { - // TODO Auto-generated method stub throw new RuntimeException("This ability is intended to indicate \"land to play\" choice only"); } @Override diff --git a/forge-gui/src/main/java/forge/game/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/game/player/PlayerControllerHuman.java index 06cc79d04d5..a586a99e3dc 100644 --- a/forge-gui/src/main/java/forge/game/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/game/player/PlayerControllerHuman.java @@ -105,9 +105,12 @@ public class PlayerControllerHuman extends PlayerController { return null; } if (abilities.size() == 1 && !abilities.get(0).promptIfOnlyPossibleAbility()) { - return abilities.get(0); + if (abilities.get(0).canPlay()) { + return abilities.get(0); //only return ability if it's playable, otherwise return null + } + return null; } - + //show menu if mouse was trigger for ability final JPopupMenu menu = new JPopupMenu("Abilities"); @@ -120,7 +123,7 @@ public class PlayerControllerHuman extends PlayerController { public void run() { CMessage.SINGLETON_INSTANCE.getInputControl().selectAbility(ab); } - }, ab.getActivatingPlayer() == null || ab.canPlay()); //check getActivatingPlayer() to account for playing lands + }, ab.canPlay()); shortcut++; if (shortcut > KeyEvent.VK_9) { shortcut = 0; //stop adding shortcuts after 9