mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
fix classcast exception in GuardianProject
This commit is contained in:
parent
1955e72395
commit
14ac6609db
1 changed files with 3 additions and 2 deletions
|
@ -19,6 +19,7 @@ import mage.filter.predicate.other.OwnerIdPredicate;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.filter.predicate.permanent.TokenPredicate;
|
import mage.filter.predicate.permanent.TokenPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.events.EntersTheBattlefieldEvent;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
@ -71,7 +72,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||||
if (!filter.match(permanent, sourceId, controllerId, game)) {
|
if (!filter.match(permanent, sourceId, controllerId, game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +98,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!permanent.getName().equals("")) {
|
if (!permanent.getName().isEmpty()) {
|
||||||
FilterCard filterCard = new FilterCard();
|
FilterCard filterCard = new FilterCard();
|
||||||
filterCard.add(new NamePredicate(permanent.getName()));
|
filterCard.add(new NamePredicate(permanent.getName()));
|
||||||
filterCard.add(new OwnerIdPredicate(controllerId));
|
filterCard.add(new OwnerIdPredicate(controllerId));
|
||||||
|
|
Loading…
Reference in a new issue