* Splinter Twin - Fixed that no token was created if the enchnated permanent left battlefield meanwhile (fixes #1429).

This commit is contained in:
LevelX2 2016-01-08 15:07:41 +01:00
parent 0f4294a66c
commit 0e4de763d8
2 changed files with 77 additions and 1 deletions

View file

@ -42,6 +42,7 @@ import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
import mage.util.functions.ApplyToPermanent;
import mage.util.functions.EmptyApplyToPermanent;
@ -125,7 +126,13 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
UUID targetId;
if (getTargetPointer() instanceof FixedTarget) {
targetId = ((FixedTarget) getTargetPointer()).getTarget();
} else {
targetId = getTargetPointer().getFirst(game, source);
}
Permanent permanent = game.getPermanentOrLKIBattlefield(targetId);
Card copyFrom;
ApplyToPermanent applier = new EmptyApplyToPermanent();
if (permanent != null) {