mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
* Fixed a bug in calculation of available mana that can be a source of heavy server load.
This commit is contained in:
parent
fcd1d89137
commit
0722276ca4
3 changed files with 43 additions and 4 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue