* It That Betrayed - Fixed a bug that sacrificing controlled but not owned permanents came back to the battlefield of the controller of It That Betrayed (fixes #796).

This commit is contained in:
LevelX2 2015-03-14 10:56:22 +01:00
parent 190f9dc0b3
commit 73cddda79c
2 changed files with 4 additions and 6 deletions

View file

@ -27,15 +27,14 @@
*/
package mage.abilities.common;
import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import mage.game.permanent.PermanentToken;
import mage.target.targetpointer.FixedTarget;
public class OpponentSacrificesNonTokenPermanentTriggeredAbility extends TriggeredAbilityImpl {
@ -54,9 +53,9 @@ public class OpponentSacrificesNonTokenPermanentTriggeredAbility extends Trigger
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getPlayer(this.getControllerId()).hasOpponent(event.getPlayerId(), game)) {
MageObject object = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (object instanceof Permanent && !(object instanceof PermanentToken) ) {
if (game.getPlayer(getControllerId()).hasOpponent(event.getPlayerId(), game)) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && !(permanent instanceof PermanentToken) ) {
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}

View file

@ -146,7 +146,6 @@ public class PermanentCard extends PermanentImpl {
Player owner = game.getPlayer(ownerId);
game.rememberLKI(objectId, Zone.BATTLEFIELD, this);
if (owner != null) {
this.setControllerId(ownerId); // neccessary for e.g. abilities in graveyard or hand to not have a controller != owner
if (originalCard != null) {
originalCard.updateZoneChangeCounter();
}