* Fixed a bug in calculation of available mana that can be a source of heavy server load.

This commit is contained in:
LevelX2 2015-02-13 08:39:44 +01:00
parent fcd1d89137
commit 0722276ca4
3 changed files with 43 additions and 4 deletions

View file

@ -170,11 +170,11 @@ public class ManaOptions extends ArrayList<Mana> {
for (Mana mana: copy) {
Mana newMana = new Mana();
newMana.add(mana);
if (mana.contains(ability.getManaCosts().getMana())) {
if (mana.includesMana(ability.getManaCosts().getMana())) {
newMana.subtractCost(ability.getManaCosts().getMana());
newMana.add(netMana);
}
this.add(newMana);
this.add(newMana);
}
}
}
}
@ -228,7 +228,7 @@ public class ManaOptions extends ArrayList<Mana> {
boolean repeatable = false;
if (addMana.getAny() == 1 && addMana.count() == 1 && onlyManaCosts) {
// deactivated because it does cause loops TODO: Find reason
//repeatable = true; // only replace to any with mana costs only will be repeated if able
repeatable = true; // only replace to any with mana costs only will be repeated if able
}
for (Mana mana: this) {
while (mana.includesMana(cost)) {