- Fixed ManaEffect with AnyMana crashing, e.g. for Chromatic Star (temporarily fixed it by reverting the relevant part to the previous version, feel free to revert and commit a more optimal fix)

This commit is contained in:
Agetian
2014-02-03 06:25:51 +00:00
parent e592d3bc56
commit 9cd2bc595d

View File

@@ -79,15 +79,21 @@ public class ManaEffect extends SpellAbilityEffect {
String colorsNeeded = abMana.getExpressChoice();
String choice = "";
ColorSet colorMenu = null;
byte mask = 0;
//loop through colors to make menu
for (int nChar = 0; nChar < colorsNeeded.length(); nChar++) {
mask |= MagicColor.fromName(colorsNeeded.charAt(nChar));
if (colorsNeeded.length() > 1 && colorsNeeded.length() < 5) {
byte mask = 0;
//loop through colors to make menu
for (int nChar = 0; nChar < colorsNeeded.length(); nChar++) {
mask |= forge.card.MagicColor.fromName(colorsNeeded.substring(nChar, nChar + 1));
}
colorMenu = ColorSet.fromMask(mask);
}
else {
colorMenu = ColorSet.fromNames(MagicColor.Constant.ONLY_COLORS);
}
colorMenu = ColorSet.fromMask(mask);
byte val = act.getController().chooseColor("Select Mana to Produce", sa, colorMenu);
if (0 == val) {
throw new RuntimeException("AbilityFactoryMana::manaResolve() - " + act + " color mana choice is empty for " + card.getName());
}