aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-15 13:56:10 -0400
committerhistoria <[not public]>2026-09-15 13:56:48 -0400
commitb3568f03e4103dd46db2ccc680fbab0a6454d604 (patch)
treedb3f6bb4f3d7c1deefbcd50de0f5022756d6b9ae /internal/game/casino.go
parentf4ea40c4b3589104dfaced3481ba19c5735889ae (diff)
downloadthehouseoficarus-b3568f03e4103dd46db2ccc680fbab0a6454d604.tar.gz
fix: telnet buffer reuse, bank stack handling,
transport casino gate, and admin cache invalidation
Diffstat (limited to 'internal/game/casino.go')
-rw-r--r--internal/game/casino.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/game/casino.go b/internal/game/casino.go
index 9f3b524..2e80bf3 100644
--- a/internal/game/casino.go
+++ b/internal/game/casino.go
@@ -47,6 +47,16 @@ func (w casinoWallet) PayCredits(amount int) {
// then credits.
func casinoAffordable(p *player.Player) int { return p.Credits + countChips(p) }
+// inCasinoGame reports whether the player is currently seated at any casino
+// table or machine. Nil-safe for test scaffolding without a Casino manager.
+func (g *Game) inCasinoGame(name string) bool {
+ if g.Casino == nil {
+ return false
+ }
+ _, playing := g.Casino.Participation(name)
+ return playing
+}
+
func (g *Game) casinoTable(roomID int, gameName string) (*casino.Table, bool) {
room, err := g.World.LoadRoom(roomID)
if err != nil {