Fixed DiesTriggeredAbility not working.

This commit is contained in:
magenoxx 2012-02-04 00:36:17 +04:00
parent 37e5c135f5
commit 7b6cedacfa

View file

@ -49,9 +49,9 @@ public class TriggeredAbilities extends AbilitiesImpl<TriggeredAbility> {
public void checkTriggers(GameEvent event, Game game) { public void checkTriggers(GameEvent event, Game game) {
for (TriggeredAbility ability: this) { for (TriggeredAbility ability: this) {
if (ability.isInUseableZone(game)) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE || ability.isInUseableZone(game)) {
MageObject object = game.getObject(ability.getSourceId()); MageObject object = game.getObject(ability.getSourceId());
if (object.getAbilities().contains(ability)) { if (object != null && object.getAbilities().contains(ability)) {
if (ability.checkTrigger(event, game)) { if (ability.checkTrigger(event, game)) {
ability.trigger(game, ability.getControllerId()); ability.trigger(game, ability.getControllerId());
} }