Stitcher Geralf: avoid prompting when no match

This commit is contained in:
tool4EvEr
2021-12-15 23:55:50 +01:00
parent cc04ca9e4a
commit a168e5b2ed

View File

@@ -554,6 +554,11 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
return singleChosen == null ? CardCollection.EMPTY : new CardCollection(singleChosen); return singleChosen == null ? CardCollection.EMPTY : new CardCollection(singleChosen);
} }
final CardCollection choices = new CardCollection();
if (sourceList.isEmpty()) {
return choices;
}
getGui().setPanelSelection(CardView.get(sa.getHostCard())); getGui().setPanelSelection(CardView.get(sa.getHostCard()));
if (useSelectCardsInput(sourceList)) { if (useSelectCardsInput(sourceList)) {
@@ -571,7 +576,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
List<CardView> views = getGui().many(title, localizer.getMessage("lblChosenCards"), min, max, List<CardView> views = getGui().many(title, localizer.getMessage("lblChosenCards"), min, max,
gameCachechoose.getTrackableKeys(), CardView.get(sa.getHostCard())); gameCachechoose.getTrackableKeys(), CardView.get(sa.getHostCard()));
endTempShowCards(); endTempShowCards();
final CardCollection choices = new CardCollection();
gameCachechoose.addToList(views, choices); gameCachechoose.addToList(views, choices);
return choices; return choices;
} }