dkforest

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

commit 5811aa734ba562a9252cf3d55adad7f9c40f4261
parent 7c5c5f3b995169c2a7fdea31da9089bdcf0830cb
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue,  5 Dec 2023 22:59:21 -0500

cleanup

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -308,6 +308,9 @@ OUTER: func dealerThread(g *PokerGame, roomID string) { roomTopic := "room_" + roomID + var winner *PokerPlayer + var winnerHand string + var minScore int32 = math.MaxInt32 type Seat struct { Top int @@ -455,11 +458,6 @@ func dealerThread(g *PokerGame, roomID string) { } } -END: - - var winner *PokerPlayer - var winnerHand string - var minScore int32 = math.MaxInt32 for _, p := range g.Ongoing.Players { if p != nil { hand := []poker.Card{ @@ -480,6 +478,18 @@ END: } } +END: + + if winner == nil { + for _, p := range g.Ongoing.Players { + if p != nil && !p.Folded { + winner = p + winnerHand = "Only player alive" + break + } + } + } + winner.Cash += g.Ongoing.MainPot g.Ongoing.MainPot = 0 @@ -1031,9 +1041,9 @@ body { .takeSeat1 { position: absolute; top: 80px; left: 700px; } .takeSeat2 { position: absolute; top: 200px; left: 670px; } .takeSeat3 { position: absolute; top: 300px; left: 610px; } -.takeSeat4 { position: absolute; top: 300px; left: 550px; } -.takeSeat5 { position: absolute; top: 300px; left: 500px; } -.takeSeat6 { position: absolute; top: 300px; left: 450px; } +.takeSeat4 { position: absolute; top: 333px; left: 485px; } +.takeSeat5 { position: absolute; top: 333px; left: 300px; } +.takeSeat6 { position: absolute; top: 333px; left: 95px; } #dealBtn { position: absolute; top: 400px; left: 50px; width: 80px; height: 30px; } #unSitBtn { position: absolute; top: 430px; left: 50px; width: 80px; height: 30px; } #checkBtn { width: 60px; height: 30px; }