mirror of
https://github.com/correl/mage.git
synced 2024-11-16 03:00:12 +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)) {
|
if (super.activate(game, noMana)) {
|
||||||
// save amount of times commander was cast
|
// save amount of times commander was cast
|
||||||
Integer castCount = (Integer) game.getState().getValue(sourceId + "_castCount");
|
Integer castCount = (Integer) game.getState().getValue(sourceId + "_castCount");
|
||||||
castCount++;
|
if (castCount == null) {
|
||||||
|
castCount = 1;
|
||||||
|
} else {
|
||||||
|
castCount++;
|
||||||
|
}
|
||||||
game.getState().setValue(sourceId + "_castCount", castCount);
|
game.getState().setValue(sourceId + "_castCount", castCount);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue