mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Fixed possible null pointer exception for commander cast count.
This commit is contained in:
parent
3f4b322705
commit
d3ff285cc5
1 changed files with 5 additions and 1 deletions
|
@ -57,7 +57,11 @@ public class CastCommanderAbility extends SpellAbility {
|
|||
if (super.activate(game, noMana)) {
|
||||
// save amount of times commander was cast
|
||||
Integer castCount = (Integer) game.getState().getValue(sourceId + "_castCount");
|
||||
castCount++;
|
||||
if (castCount == null) {
|
||||
castCount = 1;
|
||||
} else {
|
||||
castCount++;
|
||||
}
|
||||
game.getState().setValue(sourceId + "_castCount", castCount);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue