commit 65e40db5828793a529fb29ed9dddeee9f2066871
parent 09ffeb8443320c948b5d239ece7169cf091d1b8b
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Tue, 5 Dec 2023 15:17:04 -0500
fix
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/pkg/web/handlers/poker.go b/pkg/web/handlers/poker.go
@@ -179,15 +179,17 @@ func (g *PokerGame) Deal(roomID string) {
PokerPubSub.Pub(roomTopic, PlayerFoldEvent{Card1Idx: player.Cards[0].Idx, Card2Idx: player.Cards[1].Idx})
} else if evt.Check {
} else if evt.Call {
+ bet := minBet
if g.Ongoing.Players[i].Cash < g.Ongoing.Players[i].Bet {
- g.Ongoing.Players[i].Bet += g.Ongoing.Players[i].Cash
+ bet = g.Ongoing.Players[i].Cash
+ g.Ongoing.Players[i].Bet += bet
g.Ongoing.Players[i].Cash = 0
// All in
} else {
- g.Ongoing.Players[i].Bet += minBet
- g.Ongoing.Players[i].Cash -= minBet
+ g.Ongoing.Players[i].Bet += bet
+ g.Ongoing.Players[i].Cash -= bet
}
- PokerPubSub.Pub(roomTopic, PlayerBetEvent{PlayerIdx: i, Player: p.Username, Bet: evt.Bet, TotalBet: g.Ongoing.Players[i].Bet, Cash: g.Ongoing.Players[i].Cash})
+ PokerPubSub.Pub(roomTopic, PlayerBetEvent{PlayerIdx: i, Player: p.Username, Bet: bet, TotalBet: g.Ongoing.Players[i].Bet, Cash: g.Ongoing.Players[i].Cash})
} else if evt.Bet > 0 {
if evt.Bet < minBet {
fmt.Println("BET TOO LOW", evt.Bet, minBet)