SpellAbilityStackInstance keeps original activating player and restores it on getSpellAbility call

This commit is contained in:
Maxmtg
2013-05-15 04:11:23 +00:00
parent 77e9ebc456
commit 37655012ad

View File

@@ -21,6 +21,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import forge.Card; import forge.Card;
import forge.game.player.Player;
/** /**
* <p> * <p>
@@ -44,6 +45,7 @@ public class SpellAbilityStackInstance {
/** The sub instace. */ /** The sub instace. */
private SpellAbilityStackInstance subInstace = null; private SpellAbilityStackInstance subInstace = null;
private final Player activator;
// When going to a SubAbility that SA has a Instance Choice object // When going to a SubAbility that SA has a Instance Choice object
/** The tc. */ /** The tc. */
@@ -85,6 +87,7 @@ public class SpellAbilityStackInstance {
// Base SA info // Base SA info
this.ability = sa; this.ability = sa;
this.stackDescription = this.ability.getStackDescription(); this.stackDescription = this.ability.getStackDescription();
this.activator = sa.getActivatingPlayer();
// Payment info // Payment info
this.paidHash = this.ability.getPaidHash(); this.paidHash = this.ability.getPaidHash();
@@ -135,6 +138,7 @@ public class SpellAbilityStackInstance {
this.ability.getTarget().resetTargets(); this.ability.getTarget().resetTargets();
this.ability.getTarget().setTargetChoices(this.tc); this.ability.getTarget().setTargetChoices(this.tc);
} }
this.ability.setActivatingPlayer(activator);
// Saved sub-SA needs to be reset on the way out // Saved sub-SA needs to be reset on the way out
if (this.subInstace != null) { if (this.subInstace != null) {