projects
/
pokerwave.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87dc54a
)
check only nonempty hands to see if all players have passed
author
Geoffrey Allott
<geoffrey@allott.email>
Wed, 14 Jun 2023 18:48:02 +0000
(19:48 +0100)
committer
Geoffrey Allott
<geoffrey@allott.email>
Wed, 14 Jun 2023 18:48:02 +0000
(19:48 +0100)
site/modules/cribbage.js
patch
|
blob
|
history
diff --git
a/site/modules/cribbage.js
b/site/modules/cribbage.js
index ac71cdac3169e17309041239c5c1000395735554..0b873195cda9f207205b5f5e8ada0a5c43ca8e93 100644
(file)
--- 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);