From 843a09b07488e30360a4faae8863c7f4347fef73 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 23 Sep 2017 09:57:37 -0400 Subject: [PATCH 1/2] fixed activated abilities not being controlled by the player who activated it (#4047) --- Mage/src/main/java/mage/players/PlayerImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage/src/main/java/mage/players/PlayerImpl.java b/Mage/src/main/java/mage/players/PlayerImpl.java index aa9321c2f6..1567246fda 100644 --- a/Mage/src/main/java/mage/players/PlayerImpl.java +++ b/Mage/src/main/java/mage/players/PlayerImpl.java @@ -1108,6 +1108,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, ability.getId(), ability.getSourceId(), playerId))) { int bookmark = game.bookmarkState(); ability.newId(); + ability.setControllerId(playerId); game.getStack().push(new StackAbility(ability, playerId)); if (ability.activate(game, false)) { game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATED_ABILITY, ability.getId(), ability.getSourceId(), playerId)); From 631acef6b9b514c3e3b0cfe62c680f817fcc2ac1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 23 Sep 2017 17:40:42 -0400 Subject: [PATCH 2/2] updated defending player predicate --- .../predicate/permanent/DefendingPlayerControlsPredicate.java | 2 +- .../predicate/permanent/DefendingPlayerOwnsCardPredicate.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerControlsPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerControlsPredicate.java index 3bd9e326e6..ee0606669b 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerControlsPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerControlsPredicate.java @@ -40,7 +40,7 @@ public class DefendingPlayerControlsPredicate implements ObjectSourcePlayerPredi @Override public boolean apply(ObjectSourcePlayer input, Game game) { - return input.getObject().getControllerId().equals(game.getCombat().getDefenderId(input.getSourceId())); + return input.getObject().getControllerId().equals(game.getCombat().getDefendingPlayerId(input.getSourceId())); } @Override diff --git a/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java b/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java index defa91a6d5..a46ebcb3d7 100644 --- a/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/permanent/DefendingPlayerOwnsCardPredicate.java @@ -40,7 +40,7 @@ public class DefendingPlayerOwnsCardPredicate implements ObjectSourcePlayerPredi @Override public boolean apply(ObjectSourcePlayer input, Game game) { - return input.getObject().getOwnerId().equals(game.getCombat().getDefenderId(input.getSourceId())); + return input.getObject().getOwnerId().equals(game.getCombat().getDefendingPlayerId(input.getSourceId())); } @Override