From ce3176adf268e77c23652cb617ab1424d0fbca80 Mon Sep 17 00:00:00 2001 From: Zzooouhh Date: Thu, 23 Nov 2017 09:32:14 +0100 Subject: [PATCH] Fix for Giant Turtle/Halls of Mist watcher --- .../mage/watchers/common/AttackedLastTurnWatcher.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java b/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java index d809424a3b..6a2a777b89 100644 --- a/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java +++ b/Mage/src/main/java/mage/watchers/common/AttackedLastTurnWatcher.java @@ -81,7 +81,7 @@ public class AttackedLastTurnWatcher extends Watcher { } if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { UUID attackingPlayer = game.getCombat().getAttackingPlayerId(); - Set attackingCreatures = getAttackedLastTurnCreatures(attackingPlayer); + Set attackingCreatures = getAttackedThisTurnCreatures(attackingPlayer); for (UUID attackerId : game.getCombat().getAttackers()) { Permanent attacker = game.getPermanent(attackerId); if (attacker != null) { @@ -100,6 +100,13 @@ public class AttackedLastTurnWatcher extends Watcher { return new HashSet<>(); } + public Set getAttackedThisTurnCreatures(UUID combatPlayerId) { + if (attackedThisTurnCreatures.get(combatPlayerId) != null) { + return attackedThisTurnCreatures.get(combatPlayerId); + } + return new HashSet<>(); + } + @Override public AttackedLastTurnWatcher copy() { return new AttackedLastTurnWatcher(this);