aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/types.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-19 01:55:34 -0400
committerhistoria <[not public]>2026-09-19 01:55:34 -0400
commitcc33072eced3d5460512c09c42ec4531c807d7af (patch)
treeb1b451fa87fa389cb8343a3645372f3b43f5523e /internal/casino/types.go
parent2c38386484cdb507c4687caceb37e0b963e33594 (diff)
downloadthehouseoficarus-cc33072eced3d5460512c09c42ec4531c807d7af.tar.gz
fix: casino stake preservation, world state reconciliation, casino game registration
Diffstat (limited to 'internal/casino/types.go')
-rw-r--r--internal/casino/types.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/casino/types.go b/internal/casino/types.go
index 0400df4..e057ba6 100644
--- a/internal/casino/types.go
+++ b/internal/casino/types.go
@@ -176,11 +176,11 @@ func (c TableConfig) Normalize() TableConfig {
if c.MaxBet <= 0 {
c.MaxBet = DefaultMaxBet
}
- // Normalize the nested game rule blocks too: a new game that reads
- // t.Config.Blackjack/Baccarat directly (rather than only t.Rules) would
- // otherwise see zero values and build an empty shoe.
- c.Blackjack = c.Blackjack.Normalize()
- c.Baccarat = c.Baccarat.Normalize()
+ // Normalize the game's own rule block through its registration, so a new
+ // game gets its defaults without a third switch to remember.
+ if def, ok := tableGameDefFor(c.Game); ok {
+ c = def.normalize(c)
+ }
if c.MaxBet < c.MinBet {
c.MaxBet = c.MinBet
}