From f300c61c81fd5c9cb15d6be6c0b0bcff38e3116a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 22 Sep 2023 15:25:44 +0200 Subject: [PATCH] cli: treat currently played card as trash in draw selection --- src/cli_interface.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cli_interface.cpp b/src/cli_interface.cpp index bfc9f5e..0752238 100644 --- a/src/cli_interface.cpp +++ b/src/cli_interface.cpp @@ -93,7 +93,8 @@ namespace Hanabi { unsigned num_trash = 0; std::optional trash_discard_prob = 0; for(const auto &[card_multiplicity, probability]: next_states) { - if (game->is_trash(card_multiplicity.card)) { + // If the card is played, we can treat it as a trash draw as well + if (game->is_trash(card_multiplicity.card) or (play and game->cur_hand()[index] == card_multiplicity.card)) { num_trash += card_multiplicity.multiplicity; trash_discard_prob = probability; } else {