- Fix for ManaCost where X X doesn't have an additional mana payment (and causes an out of range error

This commit is contained in:
jendave
2011-08-06 16:43:00 +00:00
parent 0fa3ddf0d6
commit 508197af50

View File

@@ -17,11 +17,14 @@ public class ManaCost {
//"GW" can be paid with either G or W
public ManaCost(String manaCost) {
if (manaCost.equals("") || manaCost.equals("X"))
if (manaCost.equals(""))
manaCost = "0";
while (manaCost.startsWith("X")){
manaCost = manaCost.substring(2);
if (manaCost.length() < 2)
manaCost = "0";
else
manaCost = manaCost.substring(2);
xcounter++;
}
manaPart = split(manaCost);