diff options
| author | historia <[not public]> | 2026-10-03 00:51:41 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-03 00:51:41 -0400 |
| commit | 82e571d227feeafd0af4011e701ce26b99c5e3d9 (patch) | |
| tree | ab4d56ddf94c3bf3b42fff5dfc2ff9a339f09113 /internal/casino/craps_clock.go | |
| parent | cac16d1725c46c82a2e62b84c93f7090b2ce0746 (diff) | |
| download | thehouseoficarus-82e571d227feeafd0af4011e701ce26b99c5e3d9.tar.gz | |
fix: craps felt and wager description cleanup
Diffstat (limited to 'internal/casino/craps_clock.go')
| -rw-r--r-- | internal/casino/craps_clock.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/casino/craps_clock.go b/internal/casino/craps_clock.go index 5357c93..30f56e5 100644 --- a/internal/casino/craps_clock.go +++ b/internal/casino/craps_clock.go @@ -27,6 +27,17 @@ func (t *crapsTable) shooter() *crapsPlayer { } return t.players.get(t.queue[0]) } + +// busy reports whether the named player's dice are still in the air. The +// command loop uses it to hold the prompt until the roll resolves, so the +// shake message is not split from its result by a stray prompt. Other players +// may still bet (and be prompted) during the same window. +func (t *crapsTable) busy(name string) bool { + t.mu.Lock() + defer t.mu.Unlock() + s := t.shooter() + return t.pendingRollTicks > 0 && s != nil && s.Name == name +} func (t *crapsTable) hasLiveBets() bool { for _, p := range t.players.ordered() { if p.HasBet { |
