From 69fb90f6876d7f7dbe7be0d515c94849e5431caf Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 15 Sep 2026 17:04:48 -0400 Subject: cmd_quit gracefully departs casino games; cmd_stop cancels a pending quit --- internal/game/cmd_quit.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'internal/game/cmd_quit.go') 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) -- cgit v1.2.3