Merge branch 'castSALastZoneFix' into 'master'

CastSA: fix LastZone use LKI copy when put on stack

See merge request core-developers/forge!2790
This commit is contained in:
Michael Kamensky
2020-05-08 03:38:11 +00:00
2 changed files with 13 additions and 3 deletions

View File

@@ -293,7 +293,12 @@ public final class CardUtil {
newCopy.addOptionalCostPaid(ocost);
}
newCopy.setCastSA(in.getCastSA());
if (in.getCastSA() != null) {
SpellAbility castSA = in.getCastSA().copy(newCopy, true);
castSA.setLastStateBattlefield(CardCollection.EMPTY);
castSA.setLastStateGraveyard(CardCollection.EMPTY);
newCopy.setCastSA(castSA);
}
newCopy.setCastFrom(in.getCastFrom());
newCopy.setExiledWith(in.getExiledWith());

View File

@@ -136,8 +136,13 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
// if the ability is a spell, but not a copied spell and its not already
// on the stack zone, move there
if (ability.isSpell()) {
if (!source.isCopiedSpell() && !source.isInZone(ZoneType.Stack)) {
ability.setHostCard(game.getAction().moveToStack(source, ability));
if (!source.isCopiedSpell()) {
if (!source.isInZone(ZoneType.Stack)) {
ability.setHostCard(game.getAction().moveToStack(source, ability));
}
if (ability.equals(source.getCastSA())) {
source.setCastSA(ability.copy(source, true));
}
}
}