mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +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.TokenPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -71,7 +72,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (!filter.match(permanent, sourceId, controllerId, game)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -97,7 +98,7 @@ class GuardianProjectTriggeredAbility extends EntersBattlefieldAllTriggeredAbili
|
|||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
if (!permanent.getName().equals("")) {
|
||||
if (!permanent.getName().isEmpty()) {
|
||||
FilterCard filterCard = new FilterCard();
|
||||
filterCard.add(new NamePredicate(permanent.getName()));
|
||||
filterCard.add(new OwnerIdPredicate(controllerId));
|
||||
|
|
Loading…
Reference in a new issue