- Little tweak for playStack in ComputerUtil.

This commit is contained in:
Sloth
2012-03-08 17:34:37 +00:00
parent 7244ba7ab3
commit 0a54d18e60

View File

@@ -302,17 +302,22 @@ public class ComputerUtil {
* a {@link forge.card.spellability.SpellAbility} object.
*/
public static final void playStack(final SpellAbility sa) {
sa.setActivatingPlayer(AllZone.getComputerPlayer());
if (ComputerUtil.canPayCost(sa)) {
final Card source = sa.getSourceCard();
if (sa.isSpell() && !source.isCopiedSpell()) {
sa.setSourceCard(Singletons.getModel().getGameAction().moveToStack(source));
}
sa.setActivatingPlayer(AllZone.getComputerPlayer());
final Cost cost = sa.getPayCosts();
if (cost == null) {
ComputerUtil.payManaCost(sa);
AllZone.getStack().add(sa);
} else {
final CostPayment pay = new CostPayment(cost, sa);
if (pay.payComputerCosts()) {
AllZone.getStack().add(sa);
}
}
}
}