* Fixed a problem with Animate Dead and bringing creatures with triggered abilities into play that had no targets. It was related to manipulating spellAbility and not copying spellAbility correctly during states copies. (related to #4428).

This commit is contained in:
LevelX2 2018-02-17 11:54:57 +01:00
parent 77762cbf59
commit fe2eec6553
3 changed files with 15 additions and 7 deletions

View file

@ -29,7 +29,6 @@ package mage.cards;
import java.lang.reflect.Constructor;
import java.util.*;
import mage.MageObject;
import mage.MageObjectImpl;
import mage.Mana;
@ -165,6 +164,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
secondSideCardClazz = card.secondSideCardClazz;
nightCard = card.nightCard;
}
if (card.spellAbility != null) {
spellAbility = card.getSpellAbility().copy();
} else {
spellAbility = null;
}
flipCard = card.flipCard;
flipCardName = card.flipCardName;
splitCard = card.splitCard;
@ -177,6 +182,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
this.objectId = UUID.randomUUID();
this.abilities.newOriginalId();
this.abilities.setSourceId(objectId);
if (this.spellAbility != null) {
this.spellAbility.setSourceId(objectId);
}
}
public static Card createCard(String name, CardSetInfo setInfo) {