Merge pull request #5105 from spjspj/master

Fix portcullis
This commit is contained in:
spjspj 2018-07-03 23:29:36 +10:00 committed by GitHub
commit 607acf10d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,3 @@
package mage.cards.p;
import java.util.UUID;
@ -91,14 +90,18 @@ class PortcullisExileEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
}
if (permanent != null && creature != null) {
Player controller = game.getPlayer(creature.getControllerId());
Zone currentZone = game.getState().getZone(creature.getId());
if (currentZone == Zone.BATTLEFIELD) {
controller.moveCardsToExile(creature, source, game, true, CardUtil.getCardExileZoneId(game, source), permanent.getIdName());
return true;
}
}
return false;