diff options
Diffstat (limited to 'internal/casino/baccarat.go')
| -rw-r--r-- | internal/casino/baccarat.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/casino/baccarat.go b/internal/casino/baccarat.go index 6a72caa..800b5e6 100644 --- a/internal/casino/baccarat.go +++ b/internal/casino/baccarat.go @@ -86,10 +86,13 @@ func (t *baccaratTable) join(name string) []Event { func (t *baccaratTable) leave(name string) []Event { t.mu.Lock() defer t.mu.Unlock() - if !t.players.has(name) { + p := t.players.get(name) + if p == nil { return nil } - if t.phase != baccaratWaiting { + // A wager is committed for the round in flight; everyone else may stand + // up whenever they like. + if p.HasBet { return []Event{t.private(name, "You're in the middle of a baccarat round!")} } t.players.remove(name) @@ -120,7 +123,7 @@ func (t *baccaratTable) bet(name, spot string, amount int, wallet Wallet) []Even return []Event{t.private(name, "You have already bet this round.")} } if amount < t.Config.MinBet || amount > t.Config.MaxBet { - return []Event{t.private(name, fmt.Sprintf("Baccarat bets must be between %d and %d.", t.Config.MinBet, t.Config.MaxBet))} + return []Event{t.private(name, fmt.Sprintf("Baccarat bets must be %s.", betRangeText(t.Config.MinBet, t.Config.MaxBet)))} } wager, ok := wallet.Wager(amount) if !ok { |
