* GUI: fixed that some choose dialogs doesn't show possible targets (example: Haunting Voyage, #8223);

This commit is contained in:
Oleg Agafonov 2021-09-05 13:07:13 +04:00
parent bf67c4c6b4
commit 912e695f40

View file

@ -614,6 +614,8 @@ public class HumanPlayer extends PlayerImpl {
abilityControllerId = target.getAbilityController(); abilityControllerId = target.getAbilityController();
} }
Map<String, Serializable> options = new HashMap<>();
while (canRespond()) { while (canRespond()) {
Set<UUID> possibleTargets = target.possibleTargets(source == null ? null : source.getSourceId(), abilityControllerId, game); Set<UUID> possibleTargets = target.possibleTargets(source == null ? null : source.getSourceId(), abilityControllerId, game);
boolean required = target.isRequired(source != null ? source.getSourceId() : null, game); boolean required = target.isRequired(source != null ? source.getSourceId() : null, game);
@ -622,11 +624,14 @@ public class HumanPlayer extends PlayerImpl {
required = false; required = false;
} }
java.util.List<UUID> chosen = target.getTargets();
options.put("chosen", (Serializable) chosen);
updateGameStatePriority("chooseTarget", game); updateGameStatePriority("chooseTarget", game);
prepareForResponse(game); prepareForResponse(game);
if (!isExecutingMacro()) { if (!isExecutingMacro()) {
game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)),
possibleTargets, required, getOptions(target, null)); possibleTargets, required, getOptions(target, options));
} }
waitForResponse(game); waitForResponse(game);