diff options
| author | historia <[not public]> | 2026-09-15 17:04:48 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-15 17:04:48 -0400 |
| commit | 69fb90f6876d7f7dbe7be0d515c94849e5431caf (patch) | |
| tree | 15fb0f5897c537315d4283bb8265d28a13aae313 /internal/game/cmd_quit.go | |
| parent | d89504c3df74706b387b8fa829dd291e31ca01c7 (diff) | |
| download | thehouseoficarus-69fb90f6876d7f7dbe7be0d515c94849e5431caf.tar.gz | |
cmd_quit gracefully departs casino games; cmd_stop cancels a pending quit
Diffstat (limited to 'internal/game/cmd_quit.go')
| -rw-r--r-- | internal/game/cmd_quit.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/internal/game/cmd_quit.go b/internal/game/cmd_quit.go index 80ad351..24519f8 100644 --- a/internal/game/cmd_quit.go +++ b/internal/game/cmd_quit.go @@ -12,16 +12,19 @@ func (g *Game) executeQuit(sess *net.Session, args []string, rawInput string) { func (g *Game) doQuit(sess *net.Session) { p := sess.Player - // Combat blocks quitting outright; check it before forfeiting any casino - // wager so a cancelled quit never costs the player their round. + // Combat blocks quitting outright; check it before departing any casino + // game so a cancelled quit never costs the player their round. if g.Combat.Get(p.Name) != nil { sess.WriteLine("You can't rest during combat!") return } - if _, playing := g.Casino.Participation(p.Name); playing { - sess.WriteLine(g.colorize(sess, "warning", "WARNING: You're in the middle of a game!")) - g.emitCasinoEvents(g.Casino.MarkDisconnected(p.Name)) + // Depart casino games the way "stop" does: a table with a wager committed + // to the round in flight refuses and the quit is aborted, so deliberate + // exits never forfeit a stake or reveal cards mid-hand. Forfeit-on-leave + // stays reserved for genuine disconnects (hub.OnDisconnect). + if !g.leaveCasinoGames(sess, p) { + return } g.cancelAction(p) |
