Added test and fixed some possible null pointer exception.

This commit is contained in:
LevelX2 2016-10-22 13:06:41 +02:00
parent bf43ea9936
commit 07a7afa285
2 changed files with 8 additions and 7 deletions

View file

@ -1,6 +1,6 @@
XMage.de 1 (Europe/Germany) fast :xmage.de:17171
woogerworks (North America/USA) :xmage.woogerworks.com:17171
woogerworks replacement (North America/USA) :158.69.192.238:17171
woogerworks replacment (North America/USA) :158.69.192.238:17171
XMage.tahiti :xmage.tahiti.one:443
Seedds Server (Asia) :115.29.203.80:17171
localhost -> connect to your local server (must be started):localhost:17171

View file

@ -86,13 +86,14 @@ public class AddConditionalManaOfAnyColorEffect extends ManaEffect {
int value = amount.calculate(game, source, this);
boolean result = false;
ChoiceColor choice = new ChoiceColor(true);
while (!choice.isChosen()) {
controller.choose(outcome, choice, game);
if (!controller.isInGame()) {
return false;
}
}
for (int i = 0; i < value; i++) {
while (!choice.isChosen()) {
controller.choose(outcome, choice, game);
if (!controller.isInGame()) {
return false;
}
}
Mana mana = null;
if (choice.getColor().isBlack()) {
mana = manaBuilder.setMana(Mana.BlackMana(1), source, game).build();