commit bd1191fc8b7b066b2b010dd4e0ecbe7cdb935f99
parent 9e1e51d7128e3a99a94a54f3b77da9ac5c77df10
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 17 Dec 2023 08:07:13 -0500
cleanup
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -1126,14 +1126,15 @@ func autoUnsitInactivePlayers(g *PokerGame) {
for _, p := range *g.Players.Val() {
if p != nil {
playerShallBeBooted := false
- if !p.isEligible(pokerTableMinBet) {
+ pIsEligible := p.isEligible(pokerTableMinBet)
+ if !pIsEligible {
playerShallBeBooted = true
} else if p.LastActionTS.Before(ongoing.CreatedAt) {
// If the player was playing the game, must be booted if he had the chance to make actions and did not.
// If the player was not playing the game, must be booted if he's not eligible to play the next one.
op := ongoing.GetPlayer(p.Username)
playerShallBeBooted = (op != nil && op.countChancesToAction > 0) ||
- (op == nil && !p.isEligible(pokerTableMinBet))
+ (op == nil && !pIsEligible)
}
if playerShallBeBooted {
if err := g.UnSitPlayer1(p); err == nil {