diff options
Diffstat (limited to 'internal/casino/types.go')
| -rw-r--r-- | internal/casino/types.go | 10 |
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 } |
