- Fixed possible null pointer error for changeCost in Abilities that have 0 for mana cost.

- Fixed logic for uncastable spells. Now will only prevent spells that do not have a mana cost from being played.
This commit is contained in:
jendave
2011-08-06 08:32:46 +00:00
parent f05c110274
commit ff7d8ed2f4
2 changed files with 3 additions and 2 deletions

View File

@@ -152,7 +152,8 @@ public class Ability_Cost {
}
public void changeCost(SpellAbility sa){
manaCost = AllZone.GameAction.GetSpellCostChange(sa).toString();
if (manaCost != "0")
manaCost = AllZone.GameAction.GetSpellCostChange(sa).toString();
}
public String toString()

View File

@@ -3114,7 +3114,7 @@ public class GameAction {
for(SpellAbility sa:abilities) {
// for uncastables like lotus bloom, check if manaCost is blank
if(sa.canPlay() && !sa.getManaCost().equals("")) {
if(sa.canPlay() && (!sa.isSpell() || !sa.getManaCost().equals(""))) {
choices.add(sa.toString());
map.put(sa.toString(), sa);
}