mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
refactor: removed useless code on ChoiceCreatureType usage, removed possibly infinite code (game freezes) (related to #13106);
This commit is contained in:
parent
e3a94c8adf
commit
2949444089
12 changed files with 37 additions and 50 deletions
|
|
@ -59,10 +59,9 @@ public class BecomesChosenCreatureTypeTargetEffect extends OneShotEffect {
|
|||
if (nonWall) {
|
||||
typeChoice.getKeyChoices().remove(SubType.WALL.getDescription());
|
||||
}
|
||||
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
if (!player.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
|
||||
return false;
|
||||
}
|
||||
game.informPlayers(card.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoiceKey());
|
||||
chosenType = typeChoice.getChoiceKey();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Game's choose dialog to ask about creature type. Return getChoice
|
||||
* Game's choose dialog to ask about creature type.
|
||||
* <p>
|
||||
* Warning, must use getChoiceKey as result
|
||||
*/
|
||||
public class ChoiceCreatureType extends ChoiceImpl {
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@ class VolosJournalTokenEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
|
||||
player.choose(outcome, choice, game);
|
||||
if (!player.choose(outcome, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
notedTypes.add(choice.getChoiceKey());
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue