From 07a7afa285ccaf67fba6161d3683bd8f8c7e6deb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 22 Oct 2016 13:06:41 +0200 Subject: [PATCH] Added test and fixed some possible null pointer exception. --- Mage.Client/serverlist.txt | 2 +- .../common/AddConditionalManaOfAnyColorEffect.java | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Mage.Client/serverlist.txt b/Mage.Client/serverlist.txt index a049832b42d..e4c7e0a490c 100644 --- a/Mage.Client/serverlist.txt +++ b/Mage.Client/serverlist.txt @@ -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 diff --git a/Mage/src/main/java/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java b/Mage/src/main/java/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java index bd2cc3227c6..8259edb065d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/AddConditionalManaOfAnyColorEffect.java @@ -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();