From a402d9fa1f8f619669091749e7e423d857666917 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 15 Oct 2016 09:33:42 +0200 Subject: [PATCH] Added Standard Bearer, Coalition Flag and Coalition Honor Guard. --- .../TargetsHaveToTargetPermanentIfAbleEffect.java | 3 ++- Mage/src/main/java/mage/target/Targets.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/TargetsHaveToTargetPermanentIfAbleEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/TargetsHaveToTargetPermanentIfAbleEffect.java index 464a8af00eb..2e68e838130 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/TargetsHaveToTargetPermanentIfAbleEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ruleModifying/TargetsHaveToTargetPermanentIfAbleEffect.java @@ -65,8 +65,9 @@ public class TargetsHaveToTargetPermanentIfAbleEffect extends ContinuousRuleModi @Override public boolean applies(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); + Player targetingPlayer = game.getPlayer(event.getPlayerId()); if (controller != null - && controller.isHuman() // TODO: This target handling does only work for non AI players so AI logic + && targetingPlayer.isHuman() // TODO: This target handling does only work for non AI players so AI logic && controller.hasOpponent(event.getPlayerId(), game)) { StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); if (stackObject.isCopy()) { diff --git a/Mage/src/main/java/mage/target/Targets.java b/Mage/src/main/java/mage/target/Targets.java index c8c4266e693..f0565aa76f5 100644 --- a/Mage/src/main/java/mage/target/Targets.java +++ b/Mage/src/main/java/mage/target/Targets.java @@ -95,6 +95,7 @@ public class Targets extends ArrayList { if (!canChoose(source.getSourceId(), playerId, game)) { return false; } + int state = game.bookmarkState(); while (!isChosen()) { Target target = this.getUnchosen().get(0); UUID targetController = playerId; @@ -110,7 +111,8 @@ public class Targets extends ArrayList { // Check if there are some rules for targets are violated, if so reset the targets and start again if (this.getUnchosen().isEmpty() && game.replaceEvent(new GameEvent(GameEvent.EventType.TARGETS_VALID, source.getSourceId(), source.getSourceId(), source.getControllerId()), source)) { - this.clearChosen(); + game.restoreState(state, "Targets"); + clearChosen(); } } }