From aad36dda19184f301ee5be527b7c86b3e1f97be9 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 14 Jul 2020 23:18:47 +0200 Subject: [PATCH] * Fixed possible problem with setting of the spellAbility during card copies (related to eecaa232f5c106e5e8f483db1a30606ead1562e9). --- Mage/src/main/java/mage/cards/CardImpl.java | 14 +------------- .../java/mage/game/permanent/PermanentCard.java | 5 +---- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index bd153678b2..45861487a4 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -7,7 +7,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; -import mage.MageObject; import mage.MageObjectImpl; import mage.Mana; import mage.ObjectColor; @@ -15,20 +14,13 @@ import mage.abilities.*; import mage.abilities.hint.Hint; import mage.abilities.hint.HintUtils; import mage.abilities.keyword.FlashbackAbility; -import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.cards.repository.PluginClassloaderRegistery; import mage.constants.*; import mage.counters.Counter; import mage.counters.Counters; import mage.filter.FilterMana; import mage.game.*; -import mage.game.command.CommandObject; -import mage.game.events.GameEvent; -import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; -import mage.game.stack.Spell; -import mage.game.stack.StackObject; -import mage.util.GameLog; import mage.util.SubTypeList; import mage.watchers.Watcher; import org.apache.log4j.Logger; @@ -135,11 +127,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { secondSideCardClazz = card.secondSideCardClazz; nightCard = card.nightCard; } -// if (card.spellAbility != null) { -// spellAbility = (SpellAbility) abilities.get(0); -// } else { - spellAbility = null; // will be set on first getSpellAbility call. -// } + spellAbility = null; // will be set on first getSpellAbility call if card has one. flipCard = card.flipCard; flipCardName = card.flipCardName; diff --git a/Mage/src/main/java/mage/game/permanent/PermanentCard.java b/Mage/src/main/java/mage/game/permanent/PermanentCard.java index e9bd2f4d23..a78bcebe14 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentCard.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentCard.java @@ -6,7 +6,6 @@ import javax.lang.model.SourceVersion; import mage.MageObject; import mage.abilities.Abilities; import mage.abilities.Ability; -import mage.abilities.SpellAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.keyword.TransformAbility; @@ -89,9 +88,7 @@ public class PermanentCard extends PermanentImpl { } } else { this.abilities = card.getAbilities().copy(); - if (this.spellAbility != null) { - this.spellAbility = (SpellAbility) this.abilities.get(0); - } + this.spellAbility = null; // will be set on first getSpellAbility call if card has one. } // adventure cards must show adventure spell info on battlefield too /*