dkforest

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

commit c6a03688e8c0601c9400e959152d549ffafbceda
parent 21127b582b5a5d9925ad3baadda983fc55974f34
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 25 Dec 2023 13:01:04 -0500

cleanup

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -1525,18 +1525,18 @@ func processPot(winners []gameResult, mainPot, pokerTableMinBet database.PokerCh groupPlayers := group.players groupPlayersLen := len(groupPlayers) handStr := utils.Ternary(isOnlyPlayerAlive, "Only player alive", poker.RankString(group.handScore)) - calcExpectedSplit := func(mainPot database.PokerChip, allInCount int) database.PokerChip { + allInCount := 0 + calcExpectedSplit := func() database.PokerChip { return mainPot / utils.MaxInt(database.PokerChip(groupPlayersLen-allInCount), 1) } - allInCount := 0 - expectedSplit := calcExpectedSplit(mainPot, allInCount) + expectedSplit := calcExpectedSplit() for _, p := range groupPlayers { piece := utils.MinInt(p.maxGain(mainPot), expectedSplit) res = append(res, PlayerGain{Player: p, Gain: piece, Group: groupIdx, HandStr: handStr}) mainPot -= piece if p.isAllIn() { allInCount++ - expectedSplit = calcExpectedSplit(mainPot, allInCount) + expectedSplit = calcExpectedSplit() } } // If everyone in the group was all-in, we need to evaluate the next group as well