fix Crash when Animate Dead is put onto battlefield by things like Show and Tell.

This commit is contained in:
slapshot5
2012-01-19 04:10:55 +00:00
parent 1ba564fb15
commit 76688d72d5

View File

@@ -52,25 +52,6 @@ import forge.gui.input.Input;
*/ */
class CardFactoryAuras { class CardFactoryAuras {
/**
* <p>
* shouldCycle.
* </p>
*
* @param c
* a {@link forge.Card} object.
* @return a int.
*/
public static final int shouldCycle(final Card c) {
final ArrayList<String> a = c.getKeyword();
for (int i = 0; i < a.size(); i++) {
if (a.get(i).toString().startsWith("Cycling")) {
return i;
}
}
return -1;
}
/** /**
* <p> * <p>
* getCard. * getCard.
@@ -528,8 +509,14 @@ class CardFactoryAuras {
@Override @Override
public void execute() { public void execute() {
AllZone.getStack().addSimultaneousStackEntry(attach); if (targetC[0] != null) {
AllZone.getStack().addSimultaneousStackEntry(attach);
} else {
// note: this should be a state-based action, but it doesn't work currently.
// I don't know if that because it's hard-coded or what, but this fixes
// these cards being put on the battlefield not attached to anything.
AllZone.getGameAction().moveToGraveyard(card);
}
} }
}; };