mirror of
https://github.com/correl/mage.git
synced 2024-11-14 11:09:31 +00:00
* 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:
parent
f2dab4415a
commit
a072d8275f
1 changed files with 12 additions and 2 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue