* Fixed possible class cast exception.

This commit is contained in:
LevelX2 2019-01-03 17:33:52 +01:00
parent 367f692194
commit e8eaf49280

View file

@ -18,6 +18,7 @@ import mage.constants.TargetController;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.command.Commander;
import mage.game.command.Emblem;
import mage.game.command.Plane;
import mage.game.permanent.Permanent;
@ -235,6 +236,8 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa
return ((Emblem) mageObject).isControlledBy(playerId);
} else if (mageObject instanceof Plane) {
return ((Plane) mageObject).isControlledBy(playerId);
} else if (mageObject instanceof Commander) {
return ((Commander) mageObject).isControlledBy(playerId);
} else if (game.getState().getZone(this.sourceId) != Zone.BATTLEFIELD) {
return ((Card) mageObject).isOwnedBy(playerId);
}