From 9e9256cd82c81affcc6d208865098e25595fc2d2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 23 Apr 2013 23:10:44 +0200 Subject: [PATCH] Fixed #209. Aura enchantments targeting controlled creatures go to graveyard as a stet based effect, if controller of the enchanted creature is another than enchantment's controller. --- Mage/src/mage/game/GameImpl.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 0140c79464..25f6a288da 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -88,6 +88,7 @@ import java.io.IOException; import java.io.Serializable; import java.util.*; import java.util.Map.Entry; +import mage.filter.common.FilterControlledCreaturePermanent; public abstract class GameImpl> implements Game, Serializable { @@ -1134,9 +1135,17 @@ public abstract class GameImpl> implements Game, Serializa } else { Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter(); - if (!auraFilter.match(attachedTo, this) || attachedTo.hasProtectionFrom(perm, this)) { - if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { - somethingHappened = true; + if (auraFilter instanceof FilterControlledCreaturePermanent) { + if (!((FilterControlledCreaturePermanent)auraFilter).match(attachedTo, perm.getId(), perm.getControllerId(), this) || attachedTo.hasProtectionFrom(perm, this)) { + if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { + somethingHappened = true; + } + } + } else { + if (!auraFilter.match(attachedTo, this) || attachedTo.hasProtectionFrom(perm, this)) { + if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) { + somethingHappened = true; + } } } }