From 72640b372ab6825b50c4976ce0074b2d6e81031a Mon Sep 17 00:00:00 2001 From: Geoffrey Allott Date: Sun, 2 Jul 2023 22:46:18 +0100 Subject: [PATCH] fix display of active player when a player plays his last card while other players have passed --- site/modules/cribbage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/modules/cribbage.js b/site/modules/cribbage.js index c3ce18f..10710f6 100644 --- a/site/modules/cribbage.js +++ b/site/modules/cribbage.js @@ -268,7 +268,7 @@ export class Cribbage extends GameWithChat { image:this.card_image(user_action.username, user_action.action.card), }); } - if (this.count === 31) { + if (this.count === 31 || this.passed.size === [...this.hands.values()].filter(hand => hand.length > 0).length) { this.clear_pegging(); } this.active = this.player_after(user_action.username, username => !this.passed.has(username) && this.hands.has(username) && this.hands.get(username).length > 0); -- 2.34.1