commit 03cd8cbb331bba7dad94d17ba1b1c2b2b9686d09
parent bc237a242d52e156f0c559fdef9beb9ae6596aab
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Fri, 15 Dec 2023 17:37:12 -0500
cleanup
Diffstat:
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -966,17 +966,10 @@ END:
playerShallBeBooted := false
if p != nil && p.LastActionTS.Before(g.Ongoing.CreatedAt) {
// If the player was playing the game, must be booted if he had the chance to make actions and did not.
- if op := g.Ongoing.GetPlayer(p.Username); op != nil {
- if op.countChancesToAction > 0 {
- playerShallBeBooted = true
- }
-
- } else {
- // If the player was not playing the game, must be booted if he's not eligible to play the next one.
- if !p.isEligible(g.PokerTableMinBet) {
- playerShallBeBooted = true
- }
- }
+ // If the player was not playing the game, must be booted if he's not eligible to play the next one.
+ op := g.Ongoing.GetPlayer(p.Username)
+ playerShallBeBooted = (op != nil && op.countChancesToAction > 0) ||
+ (op == nil && !p.isEligible(g.PokerTableMinBet))
}
if playerShallBeBooted {
if err := g.UnSitPlayer1(db, roomID, p, idx); err == nil {