diff options
Diffstat (limited to 'internal/game/cmd_stop.go')
| -rw-r--r-- | internal/game/cmd_stop.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/game/cmd_stop.go b/internal/game/cmd_stop.go index 4b287ce..2f2a7ee 100644 --- a/internal/game/cmd_stop.go +++ b/internal/game/cmd_stop.go @@ -10,7 +10,17 @@ func (g *Game) executeStop(sess *net.Session, args []string, rawInput string) { // queue; cancel a pending quit countdown explicitly. g.cancelRest(p.Name) if _, playing := g.Casino.Participation(p.Name); playing { - g.leaveCasinoGames(p) + if table, _ := g.Casino.Participation(p.Name); table != nil { + // Normal leave refuses committed wagers. Only an explicit stop + // queues a departure; movement/quit retain their existing policy. + events := g.Casino.Leave(table.RoomID, table.Config.ID, p.Name) + if _, stillSeated := g.Casino.Participation(p.Name); stillSeated { + events = g.Casino.Action(table.RoomID, table.Config.ID, p.Name, "leave_after") + } + g.emitCasinoEvents(events) + } else { + g.leaveCasinoGames(p) + } return } ss, _ := g.safespot.Get(p.Name) |
