From 54ceaae22209adb9cbc42b5cbfeb11fda1729ce4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 30 May 2015 13:30:09 +0200 Subject: [PATCH] * Tajuru Preserver - Fixed that also opponent was not able to sacrifice permants due to the effect. --- .../riseoftheeldrazi/TajuruPreserver.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TajuruPreserver.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TajuruPreserver.java index f242ffd914d..8baf7705514 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TajuruPreserver.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TajuruPreserver.java @@ -40,6 +40,7 @@ import mage.game.permanent.PermanentCard; import mage.game.stack.Spell; import java.util.UUID; +import mage.game.permanent.Permanent; /** * @author noxx @@ -97,15 +98,18 @@ class TajuruPreserverEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - MageObject object = game.getObject(event.getSourceId()); - if (object instanceof PermanentCard) { - if (game.getOpponents(source.getControllerId()).contains(((PermanentCard)object).getControllerId())) { - return true; + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + MageObject object = game.getObject(event.getSourceId()); + if (object instanceof PermanentCard) { + if (game.getOpponents(source.getControllerId()).contains(((PermanentCard)object).getControllerId())) { + return true; + } } - } - if (object instanceof Spell) { - if (game.getOpponents(source.getControllerId()).contains(((Spell)object).getControllerId())) { - return true; + if (object instanceof Spell) { + if (game.getOpponents(source.getControllerId()).contains(((Spell)object).getControllerId())) { + return true; + } } } return false;