fixed delayed triggered abilities

This commit is contained in:
BetaSteward 2012-02-04 17:02:25 -05:00
parent 65ce0c3948
commit 90c7079bfa
2 changed files with 14 additions and 0 deletions

View file

@ -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<DelayedTriggeredAbility> it = this.iterator();
while (it.hasNext()) {
DelayedTriggeredAbility ability = it.next();
if (ability.checkTrigger(event, game)) {
ability.trigger(game, ability.controllerId);
it.remove();
}
}
}
}
}

View file

@ -424,6 +424,7 @@ public class GameState implements Serializable, Copyable<GameState> {
public void handleEvent(GameEvent event, Game game) {
watchers.watch(event, game);
delayed.checkTriggers(event, game);
triggers.checkTriggers(event, game);
}