forked from External/mage
* Optimized handling and call of player.choose choice to prevent problems if a player disconnects or left a game (#4263).
This commit is contained in:
parent
b9ec919f06
commit
b752eacfaa
152 changed files with 1224 additions and 1681 deletions
|
|
@ -108,7 +108,9 @@ public class RemoveCounterCost extends CostImpl {
|
|||
}
|
||||
choice.setChoices(choices);
|
||||
choice.setMessage("Choose a counter to remove from " + permanent.getLogName());
|
||||
controller.choose(Outcome.UnboostCreature, choice, game);
|
||||
if (!controller.choose(Outcome.UnboostCreature, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
counterName = choice.getChoice();
|
||||
} else {
|
||||
for (Counter counter : permanent.getCounters(game).values()) {
|
||||
|
|
@ -117,7 +119,7 @@ public class RemoveCounterCost extends CostImpl {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (counterName != null) {
|
||||
if (counterName != null && !counterName.isEmpty()) {
|
||||
int countersLeft = countersToRemove - countersRemoved;
|
||||
int countersOnPermanent = permanent.getCounters(game).getCount(counterName);
|
||||
int numberOfCountersSelected = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue