diff options
Diffstat (limited to 'internal/casino/craps.go')
| -rw-r--r-- | internal/casino/craps.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/casino/craps.go b/internal/casino/craps.go index 73c67c4..0abf24b 100644 --- a/internal/casino/craps.go +++ b/internal/casino/craps.go @@ -133,7 +133,8 @@ func (t *crapsTable) join(name string) []Event { return append([]Event{e, t.menu(name)}, timing...) } func (t *crapsTable) remove(name string) { - if len(t.queue) > 0 && t.queue[0] == name { + wasShooter := len(t.queue) > 0 && t.queue[0] == name + if wasShooter { // The queued roll belongs to the shooter; a departing shooter cancels it. t.pendingRollTicks = 0 } @@ -152,6 +153,15 @@ func (t *crapsTable) remove(name string) { t.seen = map[int]bool{} t.phase = phaseWaiting t.window.close() + } else if wasShooter { + // The next shooter starts a fresh come-out. Without this he inherits + // the previous shooter's point (blocking pass/dontpass and bonus + // bets) and made/seen bonus progress. The shared countdown is left + // alone: it belongs to the table, not the shooter. + t.point = 0 + t.rolled = false + t.made = map[int]bool{} + t.seen = map[int]bool{} } } func (t *crapsTable) leave(name string) []Event { @@ -245,7 +255,7 @@ func (t *crapsTable) bet(name, spot string, amount int, w Wallet) []Event { } limit := t.Config.Craps.oddsLimit(b.number, against) if b.odds.Total > 0 { - continue + return reject("Odds already placed on that bet.") } requested := amount amount = roundUpTo(amount, payoutDen) |
