From 4328e597ddd3241539254bd263108f0cc6d87f29 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:38:59 +0000 Subject: [PATCH] Fixed a problem with Regrowth asking for input twice when played from Cascade. Added a Serial UID to the Command created in playSpellAbilityForFree(). --- src/forge/CardFactory.java | 16 +++++++++++++++- src/forge/GameAction.java | 5 ++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 1d55a6bd15c..9cedd3553a8 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -10506,9 +10506,23 @@ public class CardFactory implements NewConstants { spell.setTargetCard((Card) o); if(this.isFree()) { + // WARNING: Read this before copying! + // When we have an 'if (this.isFree())' in most input objects, + // it's inside 'selectCard' not 'showMessage', and the usual + // order is + // AllZone.Stack.add(spell); + // stop(); + // Here, we had to reverse the order of those two lines, or + // else the dialog for Regrowth would get put up twice + // when the card was played from Cascade. I think this + // has to do with when showMessage() is called versus + // selectCard(). + // This appears to be the only place we use this pattern. Be + // careful when copying this code, and test your card with + // Cascade or Isochron Scepter. this.setFree(false); - AllZone.Stack.add(spell); stop(); + AllZone.Stack.add(spell); } else stopSetNext(new Input_PayManaCost(spell)); diff --git a/src/forge/GameAction.java b/src/forge/GameAction.java index c21571a5df4..0d44324e906 100644 --- a/src/forge/GameAction.java +++ b/src/forge/GameAction.java @@ -1439,10 +1439,9 @@ public class GameAction { if (sa.isKickerAbility()) { Command paid1 = new Command() { - - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -6531785460264284794L; - public void execute() { + public void execute() { AllZone.Stack.add(sa); } };