From 51195501a6c6711fcc37892ef78ee65edc5b2112 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 29 Jul 2021 19:24:40 +0200 Subject: tripoli: Fix active player during simultaneous discards. --- rules.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/rules.js b/rules.js index 5d63092..e6dd4e8 100644 --- a/rules.js +++ b/rules.js @@ -615,16 +615,20 @@ function start_of_year() { } function goto_hand_size() { - if (game.us.hand.length > 8 || game.tr.hand.length > 8) { + game.state = 'hand_size'; + if (game.tr.hand.length > 8) + game.tr.queue = []; + if (game.us.hand.length > 8) + game.us.queue = []; + + if (game.tr.queue && game.us.queue) game.active = "Both"; - game.state = 'hand_size'; - if (game.tr.hand.length > 8) - game.tr.queue = []; - if (game.us.hand.length > 8) - game.us.queue = []; - } else { + else if (game.tr.queue) + game.active = TR; + else if (game.us.queue) + game.active = US; + else goto_american_play(); - } } function format_discard(n) { -- cgit v1.2.3