From 90c7079bfa5b1a679e00c4c7902d62a280108b0e Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Sat, 4 Feb 2012 17:02:25 -0500 Subject: [PATCH] fixed delayed triggered abilities --- .../mage/abilities/DelayedTriggeredAbilities.java | 13 +++++++++++++ Mage/src/mage/game/GameState.java | 1 + 2 files changed, 14 insertions(+) diff --git a/Mage/src/mage/abilities/DelayedTriggeredAbilities.java b/Mage/src/mage/abilities/DelayedTriggeredAbilities.java index c853621efb..1a56a44694 100644 --- a/Mage/src/mage/abilities/DelayedTriggeredAbilities.java +++ b/Mage/src/mage/abilities/DelayedTriggeredAbilities.java @@ -48,6 +48,19 @@ import mage.game.events.GameEvent; public DelayedTriggeredAbilities copy() { return new DelayedTriggeredAbilities(this); } + + public void checkTriggers(GameEvent event, Game game) { + if (this.size() > 0) { + Iterator it = this.iterator(); + while (it.hasNext()) { + DelayedTriggeredAbility ability = it.next(); + if (ability.checkTrigger(event, game)) { + ability.trigger(game, ability.controllerId); + it.remove(); + } + } + } + } } diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java index 7acd0d84ab..3f5f7784b7 100644 --- a/Mage/src/mage/game/GameState.java +++ b/Mage/src/mage/game/GameState.java @@ -424,6 +424,7 @@ public class GameState implements Serializable, Copyable { public void handleEvent(GameEvent event, Game game) { watchers.watch(event, game); + delayed.checkTriggers(event, game); triggers.checkTriggers(event, game); }