From 04ce4c85c01ec5f5f0a54d99252851d9209bc04b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 8 Apr 2015 16:41:49 +0200 Subject: [PATCH] * Fixed some problems with transform triggering on the wrong card side. --- Mage/src/mage/abilities/AbilityImpl.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index b4c7943d92a..4327f93f2e5 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -892,20 +892,12 @@ public abstract class AbilityImpl implements Ability { } if (object != null && !object.getAbilities().contains(this)) { - boolean found = false; - // unfortunately we need to handle double faced cards separately and only this way - if (object instanceof PermanentCard) { - if (((PermanentCard)object).canTransform()) { - PermanentCard permanent = (PermanentCard)object; - found = permanent.getSecondCardFace().getAbilities().contains(this) || permanent.getCard().getAbilities().contains(this); - } - } else { + if (!(object instanceof Permanent)) { // check if it's an ability that is temporary gained to a card Abilities otherAbilities = game.getState().getAllOtherAbilities(this.getSourceId()); - found = otherAbilities != null && otherAbilities.contains(this); - } - if (!found) { - return false; + if (otherAbilities == null || !otherAbilities.contains(this)) { + return false; + } } } // check against current state