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
|
|
@ -157,13 +157,16 @@ class AnimationModuleEffect extends OneShotEffect {
|
|||
}
|
||||
choice.setChoices(choices);
|
||||
choice.setMessage("Choose a counter");
|
||||
controller.choose(Outcome.Benefit, choice, game);
|
||||
for (Counter counter : permanent.getCounters(game).values()) {
|
||||
if (counter.getName().equals(choice.getChoice())) {
|
||||
Counter newCounter = new Counter(counter.getName());
|
||||
permanent.addCounters(newCounter, source, game);
|
||||
break;
|
||||
if (controller.choose(Outcome.Benefit, choice, game)) {
|
||||
for (Counter counter : permanent.getCounters(game).values()) {
|
||||
if (counter.getName().equals(choice.getChoice())) {
|
||||
Counter newCounter = new Counter(counter.getName());
|
||||
permanent.addCounters(newCounter, source, game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -184,13 +187,16 @@ class AnimationModuleEffect extends OneShotEffect {
|
|||
}
|
||||
choice.setChoices(choices);
|
||||
choice.setMessage("Choose a counter");
|
||||
controller.choose(Outcome.Benefit, choice, game);
|
||||
for (Counter counter : player.getCounters().values()) {
|
||||
if (counter.getName().equals(choice.getChoice())) {
|
||||
Counter newCounter = new Counter(counter.getName());
|
||||
player.addCounters(newCounter, game);
|
||||
break;
|
||||
if (controller.choose(Outcome.Benefit, choice, game)) {
|
||||
for (Counter counter : player.getCounters().values()) {
|
||||
if (counter.getName().equals(choice.getChoice())) {
|
||||
Counter newCounter = new Counter(counter.getName());
|
||||
player.addCounters(newCounter, game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue