Fixed Livewire Lash (NPE).

This commit is contained in:
North 2011-08-14 19:03:57 +03:00
parent bc8d8b4c2f
commit fb56e315fa
2 changed files with 3 additions and 4 deletions

View file

@ -44,6 +44,7 @@ import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.common.TargetCreatureOrPlayer;
/**
@ -92,8 +93,7 @@ class LivewireLashAbility extends TriggeredAbilityImpl<LivewireLashAbility> {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.TARGETED && event.getTargetId().equals(sourceId)) {
if (game.getCard(event.getSourceId()).getCardType().contains(CardType.SORCERY) ||
game.getCard(event.getSourceId()).getCardType().contains(CardType.INSTANT)) {
if (game.getObject(event.getSourceId()) instanceof Spell) {
return true;
}
}
@ -104,4 +104,4 @@ class LivewireLashAbility extends TriggeredAbilityImpl<LivewireLashAbility> {
public String getRule() {
return "Whenever this creature becomes the target of a spell, this creature deals 2 damage to target creature or player.";
}
}
}

View file

@ -30,7 +30,6 @@ package mage.filter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.Constants.CardType;
import mage.MageObject;
import mage.ObjectColor;