From e82a7b621e1ba77e20666328784fbc907150c309 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 5 Nov 2015 15:39:12 +0100 Subject: [PATCH] * Fixed a problem with countering abilities on the stack. --- Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java | 5 +---- Mage/src/mage/game/stack/SpellStack.java | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java index 42b6e9c8f4..ba19a176b1 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NotOfThisWorld.java @@ -103,10 +103,7 @@ class TargetStackObjectTargetingControlledPermanent extends TargetObject { @Override public boolean canTarget(UUID id, Ability source, Game game) { StackObject stackObject = game.getStack().getStackObject(id); - if ((stackObject instanceof Spell) || (stackObject instanceof StackAbility)) { - return true; - } - return false; + return (stackObject instanceof Spell) || (stackObject instanceof StackAbility); } @Override diff --git a/Mage/src/mage/game/stack/SpellStack.java b/Mage/src/mage/game/stack/SpellStack.java index f8b9e80b75..cf261770e8 100644 --- a/Mage/src/mage/game/stack/SpellStack.java +++ b/Mage/src/mage/game/stack/SpellStack.java @@ -105,6 +105,9 @@ public class SpellStack extends ArrayDeque { counteredObjectName = "Ability (" + stackObject.getStackAbility().getRule(targetSourceName) + ") of " + targetSourceName; } if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.COUNTER, objectId, sourceId, stackObject.getControllerId()))) { + if (!(stackObject instanceof Spell)) { // spells are removed from stack by the card movement + this.remove(stackObject); + } stackObject.counter(sourceId, game, zone, owner, onTop); if (!game.isSimulation()) { game.informPlayers(counteredObjectName + " is countered by " + sourceObject.getLogName());