* Fixed a problem with TapEnchantedEffect that could cause cast exceptions (fixes
-
-
package mage.abilities.effects.common;
-import mage.constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
+import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -25,7 +23,7 @@ public class TapEnchantedEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- Permanent permanent = (Permanent) source.getSourceObject(game);
+ Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent != null) {
Permanent attach = game.getPermanent(permanent.getAttachedTo());
if (attach != null) {
