diff options
| author | historia <[not public]> | 2026-10-05 17:05:14 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 17:05:14 -0400 |
| commit | e42952469dadfb3535633c66c881050ac128703c (patch) | |
| tree | a78f7396b72cdbd6fa4f6c454c830f40cf2ad0cb /internal/casino/pai_gow.go | |
| parent | 90ad8c0c33b519d5830c69d4128bdc984b5e9de8 (diff) | |
| download | thehouseoficarus-e42952469dadfb3535633c66c881050ac128703c.tar.gz | |
fix: gather verbs, walk oom, admin path bypass, roulette refund
Diffstat (limited to 'internal/casino/pai_gow.go')
| -rw-r--r-- | internal/casino/pai_gow.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/internal/casino/pai_gow.go b/internal/casino/pai_gow.go index a2dafcf..8f581db 100644 --- a/internal/casino/pai_gow.go +++ b/internal/casino/pai_gow.go @@ -747,8 +747,11 @@ func (t *paiGowTable) tick() []Event { if t.allBetLocked() { return t.dealLocked() } - // A lone player has no time limit; wait for their bet instead. - if t.activePlayersLocked() <= 1 { + // A lone seated player has no time limit; wait for their bet instead. + // Count seated players, not bettors: with one bettor and one idle seat + // activePlayersLocked() is 1 forever, so the window never closes and + // the round stalls. + if t.seatedPlayersLocked() <= 1 { return nil } t.ticks-- @@ -901,6 +904,18 @@ func (t *paiGowTable) activePlayersLocked() int { return n } +// seatedPlayersLocked counts connected seats, bettors or not. The betting +// window is bounded by seats present, so an idle seat still lets it expire. +func (t *paiGowTable) seatedPlayersLocked() int { + n := 0 + for _, p := range t.players { + if !p.disconnected { + n++ + } + } + return n +} + // unbetLocked takes back every wager before the deal. Refunds go through // PayCredits with the original stake handles so the ledger entries resolve in // the same save; wagers are only cleared on success. |
