aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/types.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 01:50:17 -0400
committerhistoria <[not public]>2026-09-18 01:50:17 -0400
commit87d08f0151e643951769e323995f1c5ed89ee200 (patch)
treedc42a0b30ebb5a00dd7ba505cc4eaa44f4f308bc /internal/casino/types.go
parent32a3c59cebf2a16277e54d715a67adfdbe00b456 (diff)
downloadthehouseoficarus-87d08f0151e643951769e323995f1c5ed89ee200.tar.gz
fix: harden economy recovery, shutdown concurrency, world validation, and inventory-loss paths
Diffstat (limited to 'internal/casino/types.go')
-rw-r--r--internal/casino/types.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/casino/types.go b/internal/casino/types.go
index 283aa43..49e2cc4 100644
--- a/internal/casino/types.go
+++ b/internal/casino/types.go
@@ -128,6 +128,12 @@ func (c MachineConfig) Normalize() MachineConfig {
if c.MaxBet <= 0 {
c.MaxBet = DefaultMaxBet
}
+ // Never leave a normalized config self-contradictory: a min_bet above
+ // the default cap must widen the effective maximum rather than produce
+ // a game every wager is rejected from.
+ if c.MaxBet < c.MinBet {
+ c.MaxBet = c.MinBet
+ }
if c.SpinTicks <= 0 {
c.SpinTicks = 2
}
@@ -153,6 +159,9 @@ func (c TableConfig) Normalize() TableConfig {
if c.MaxBet <= 0 {
c.MaxBet = DefaultMaxBet
}
+ if c.MaxBet < c.MinBet {
+ c.MaxBet = c.MinBet
+ }
return c
}