Fix Master of the Wild Hunt waiting forever in cases when all his wolves have died before damage allocation is complete.

This commit is contained in:
jsv
2013-06-25 12:30:42 +00:00
parent 72c7cb38b6
commit 3f24909423

View File

@@ -193,10 +193,19 @@ public class CardFactoryCreatures {
} }
if (target.getController().isHuman()) { // Human choose spread damage if (target.getController().isHuman()) { // Human choose spread damage
final Predicate<Card> stillInPlay = new Predicate<Card>() {
@Override
public boolean apply(final Card c){
return c.isInPlay();
}
};
final int netAttack = target.getNetAttack(); final int netAttack = target.getNetAttack();
for (int x = 0; x < netAttack; x++) {
for (int points = netAttack; points > 0; points--) {
if (!Iterables.any(wolves, stillInPlay)) break;
InputSelectCards inp = new InputSelectCardsFromList(1,1,wolves); InputSelectCards inp = new InputSelectCardsFromList(1,1,wolves);
inp.setMessage("Select target wolf to damage for " + getSourceCard()); inp.setMessage(String.format("Select target wolf to damage for %s (%d point%s to allocate)",
target, points, points > 1? "s": ""));
Singletons.getControl().getInputQueue().setInputAndWait(inp); Singletons.getControl().getInputQueue().setInputAndWait(inp);
inp.getSelected().get(0).addDamage(1, target); inp.getSelected().get(0).addDamage(1, target);
} }