From ec0e8181d52d26dadf3cf9d34a4bc965b461585a Mon Sep 17 00:00:00 2001 From: fwannmacher Date: Tue, 26 Jul 2016 19:32:20 -0300 Subject: [PATCH] - Fixed Issue #1660 --- ...alsDamageToAPlayerAllTriggeredAbility.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java index 7aa70be9ab..1b15255bb9 100644 --- a/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java @@ -73,25 +73,28 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp } @Override - public boolean checkTrigger(GameEvent event, Game game) { + public boolean checkTrigger(GameEvent event, Game game) { if (!onlyCombat || ((DamagedPlayerEvent) event).isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { - if (!setTargetPointer.equals(SetTargetPointer.NONE)) { - for (Effect effect : this.getEffects()) { - effect.setValue("damage", event.getAmount()); - switch (setTargetPointer) { - case PLAYER: - effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); - break; - case PERMANENT: - effect.setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game))); - break; - } + if (permanent != null) { + controllerId = permanent.getControllerId(); + if (filter.match(permanent, sourceId, controllerId, game)) { + if (!setTargetPointer.equals(SetTargetPointer.NONE)) { + for (Effect effect : this.getEffects()) { + effect.setValue("damage", event.getAmount()); + switch (setTargetPointer) { + case PLAYER: + effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); + break; + case PERMANENT: + effect.setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game))); + break; + } + } } + return true; } - return true; } } return false;