* Target card in hands - fixed that player can stuck/freeze the game if it must select cards from opponent's hand (related #6209);

This commit is contained in:
Oleg Agafonov 2020-01-21 04:44:50 +04:00
parent f2dab4415a
commit a072d8275f

View file

@ -635,7 +635,7 @@ public class HumanPlayer extends PlayerImpl {
}
// choose one or multiple cards
if (cards == null) {
if (cards == null || cards.isEmpty()) {
return false;
}
@ -666,6 +666,11 @@ public class HumanPlayer extends PlayerImpl {
options.put("choosable", (Serializable) choosable);
}
// if nothing to choose then show window (user must see non selectable items and click on any of them)
if (required && choosable.isEmpty()) {
required = false;
}
updateGameStatePriority("choose(4)", game);
prepareForResponse(game);
if (!isExecutingMacro()) {
@ -704,7 +709,7 @@ public class HumanPlayer extends PlayerImpl {
return true;
}
if (cards == null) {
if (cards == null || cards.isEmpty()) {
return false;
}
@ -735,6 +740,11 @@ public class HumanPlayer extends PlayerImpl {
options.put("choosable", (Serializable) choosable);
}
// if nothing to choose then show window (user must see non selectable items and click on any of them)
if (required && choosable.isEmpty()) {
required = false;
}
updateGameStatePriority("chooseTarget(5)", game);
prepareForResponse(game);
if (!isExecutingMacro()) {