mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Fixed a problem with TapEnchantedEffect that could cause cast exceptions (fixes #5509).
This commit is contained in:
parent
6ea09f2c51
commit
0e19ffd173
1 changed files with 7 additions and 9 deletions
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
|
||||
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;
|
||||
|
||||
|
|
@ -15,17 +13,17 @@ import mage.game.permanent.Permanent;
|
|||
public class TapEnchantedEffect extends OneShotEffect {
|
||||
|
||||
public TapEnchantedEffect() {
|
||||
super(Outcome.Tap);
|
||||
staticText = "tap enchanted creature";
|
||||
}
|
||||
super(Outcome.Tap);
|
||||
staticText = "tap enchanted creature";
|
||||
}
|
||||
|
||||
public TapEnchantedEffect(final TapEnchantedEffect effect) {
|
||||
super(effect);
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@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) {
|
||||
|
|
@ -41,4 +39,4 @@ public class TapEnchantedEffect extends OneShotEffect {
|
|||
return new TapEnchantedEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue