* Small fix to ManaOptions.

This commit is contained in:
LevelX2 2015-02-10 01:24:03 +01:00
parent b4636b2ce1
commit 4f6fb64811

View file

@ -225,15 +225,15 @@ public class ManaOptions extends ArrayList<Mana> {
if (isEmpty()) { if (isEmpty()) {
this.add(new Mana()); this.add(new Mana());
} }
boolean addAny = false; boolean repeatable = false;
if (addMana.getAny() == 1 && addMana.count() == 1) { if (addMana.getAny() == 1 && addMana.count() == 1 && onlyManaCosts) {
addAny = true; // only replace to any will be repeated repeatable = true; // only replace to any with mana costs only will be repeated if able
} }
for (Mana mana: this) { for (Mana mana: this) {
while (mana.includesMana(cost)) { while (mana.includesMana(cost)) {
mana.subtract(cost); mana.subtract(cost);
mana.add(addMana); mana.add(addMana);
if (!addAny) { if (!repeatable) {
break; break;
} }
} }