From 098eb13300438f619b838f69fef57977dd2fae83 Mon Sep 17 00:00:00 2001 From: Geoffrey Allott Date: Wed, 14 Jun 2023 19:48:02 +0100 Subject: [PATCH] check only nonempty hands to see if all 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 ac71cda..0b87319 100644 --- a/site/modules/cribbage.js +++ b/site/modules/cribbage.js @@ -272,7 +272,7 @@ export class Cribbage extends GameWithChat { break; case "Pass": this.passed.add(user_action.username); - if (this.passed.size === this.hands.size) { + if (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