Fix for Giant Turtle/Halls of Mist watcher

This commit is contained in:
Zzooouhh 2017-11-23 09:32:14 +01:00 committed by GitHub
parent 58f5dd59b9
commit ce3176adf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,7 +81,7 @@ public class AttackedLastTurnWatcher extends Watcher {
}
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
UUID attackingPlayer = game.getCombat().getAttackingPlayerId();
Set<MageObjectReference> attackingCreatures = getAttackedLastTurnCreatures(attackingPlayer);
Set<MageObjectReference> 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<MageObjectReference> getAttackedThisTurnCreatures(UUID combatPlayerId) {
if (attackedThisTurnCreatures.get(combatPlayerId) != null) {
return attackedThisTurnCreatures.get(combatPlayerId);
}
return new HashSet<>();
}
@Override
public AttackedLastTurnWatcher copy() {
return new AttackedLastTurnWatcher(this);