From f320b5507b1954846f9bafbf7490ceec597cca0c Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Fri, 7 Aug 2020 15:59:11 -0500 Subject: [PATCH] - Fixed Followed Footsteps. Related to Bug #6236 --- .../src/mage/cards/f/FollowedFootsteps.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/cards/f/FollowedFootsteps.java b/Mage.Sets/src/mage/cards/f/FollowedFootsteps.java index 3dcf780d0c..003c51e8e9 100644 --- a/Mage.Sets/src/mage/cards/f/FollowedFootsteps.java +++ b/Mage.Sets/src/mage/cards/f/FollowedFootsteps.java @@ -1,4 +1,3 @@ - package mage.cards.f; import java.util.UUID; @@ -14,6 +13,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -29,7 +29,7 @@ import mage.target.targetpointer.FixedTarget; public final class FollowedFootsteps extends CardImpl { public FollowedFootsteps(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); this.subtype.add(SubType.AURA); // Enchant creature @@ -71,12 +71,14 @@ class FollowedFootstepsEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); - Permanent target = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); - if (target != null) { - Effect effect = new CreateTokenCopyTargetEffect(); - effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); - return effect.apply(game, source); + Permanent enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + if (enchantment != null) { + Permanent target = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); + if (target != null) { + Effect effect = new CreateTokenCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); + return effect.apply(game, source); + } } return false; }