From d38c18e2107bce8f6ff66daf778662f5524f989b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 8 Jul 2023 11:43:18 +0200 Subject: Fix end game turn skipping (discard cards). --- rules.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index b17bbd8..030206c 100644 --- a/rules.js +++ b/rules.js @@ -4776,12 +4776,17 @@ function goto_buy_trash_discard() { else log("Played no cards.") - if (game.end) + if (game.end) { + // Skip rest of turn... + for (let c of game.played) + set_add(discard, c) + game.played.length = 0 goto_end_of_turn() - else if (current_hand().length > 0) + } else if (current_hand().length > 0) { game.state = "buy_trash_discard" - else + } else { goto_buy_trash() + } } states.buy_trash_discard = { @@ -5090,8 +5095,6 @@ function vp_tie(p) { function goto_game_end() { log_h1("Game End") - game.played.length = 0 - game.crisis[0] = -1 game.crisis[1] = 0 game.crisis[2] = 0 -- cgit v1.2.3