* Fixed a bug of cost reduction calculation.

This commit is contained in:
LevelX2 2015-11-26 22:56:42 +01:00
parent a8f855608e
commit 0b832c9b11

View file

@ -225,10 +225,11 @@ public class CardUtil {
for (ManaCost manaCost : manaCosts) { for (ManaCost manaCost : manaCosts) {
Mana mana = manaCost.getOptions().get(0); Mana mana = manaCost.getOptions().get(0);
int colorless = mana != null ? mana.getColorless() : 0; int colorless = mana != null ? mana.getColorless() : 0;
if (!updated && restToReduce != 0 && colorless > 0) { if (restToReduce != 0 && colorless > 0) {
if ((colorless - restToReduce) > 0) { if ((colorless - restToReduce) > 0) {
int newColorless = colorless - restToReduce; int newColorless = colorless - restToReduce;
adjustedCost.add(new GenericManaCost(newColorless)); adjustedCost.add(new GenericManaCost(newColorless));
restToReduce = 0;
} else { } else {
restToReduce -= colorless; restToReduce -= colorless;
} }