From: Geoffrey Allott Date: Sun, 2 Jul 2023 21:46:18 +0000 (+0100) Subject: fix display of active player when a player plays his last card while other players... X-Git-Url: https://git.pointlesshacks.com/?a=commitdiff_plain;h=72640b372ab6825b50c4976ce0074b2d6e81031a;p=pokerwave.git fix display of active player when a player plays his last card while other players have passed --- 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);