diff options
| author | historia <[not public]> | 2026-09-15 13:56:10 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-15 13:56:48 -0400 |
| commit | b3568f03e4103dd46db2ccc680fbab0a6454d604 (patch) | |
| tree | db3f6bb4f3d7c1deefbcd50de0f5022756d6b9ae /internal/game/cmd_quit.go | |
| parent | f4ea40c4b3589104dfaced3481ba19c5735889ae (diff) | |
| download | thehouseoficarus-b3568f03e4103dd46db2ccc680fbab0a6454d604.tar.gz | |
fix: telnet buffer reuse, bank stack handling,
transport casino gate, and admin cache invalidation
Diffstat (limited to 'internal/game/cmd_quit.go')
| -rw-r--r-- | internal/game/cmd_quit.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/game/cmd_quit.go b/internal/game/cmd_quit.go index fa4038b..0eb8fb9 100644 --- a/internal/game/cmd_quit.go +++ b/internal/game/cmd_quit.go @@ -11,16 +11,19 @@ func (g *Game) executeQuit(sess *net.Session, args []string, rawInput string) { func (g *Game) doQuit(sess *net.Session) { p := sess.Player - 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)) - } + // Combat blocks quitting outright; check it before forfeiting any casino + // wager 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)) + } + g.cancelAction(p) g.cancelRest(p.Name) |
