dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit df7e843b024a8de728e0b0edf85422a8e6e3c935
parent dc3351df9119e1723c03731ed7fc672fd9e3eba3
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu,  7 Dec 2023 23:10:40 -0500

improve UX

Diffstat:
Mpkg/web/handlers/poker/poker.go | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -344,6 +344,17 @@ func waitPlayersActionFn(g *PokerGame, roomID string, skip, minBet int) bool { roomTopic := "room_" + roomID lastRisePlayerIdx := -1 + // Avoid asking for actions if only 1 player can do so (because others are all-in) + nbCanVote := 0 + for _, p := range g.Ongoing.Players { + if !p.Folded && p.Cash > 0 { + nbCanVote++ + } + } + if nbCanVote <= 1 { + return false + } + g.DealerIdxMtx.RLock() dealerIdx := g.DealerIdx g.DealerIdxMtx.RUnlock()