From 7eab582d8a8ee2af1a6baae7baf0696c7005de2e Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 15:16:44 -0400 Subject: fix: harden triggers, economy, casino, world data, and admin/net paths --- internal/casino/cards.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/casino/cards.go') diff --git a/internal/casino/cards.go b/internal/casino/cards.go index 27da8aa..2d53b4a 100644 --- a/internal/casino/cards.go +++ b/internal/casino/cards.go @@ -73,6 +73,14 @@ func (s *shoe) remaining() int { return len(s.cards) } func (s *shoe) draw() card { if len(s.cards) == 0 { + if s.decks <= 0 { + // A synthetic, explicitly-scripted shoe (tests) has no decks to + // rebuild from and no cards left; return a visibly-invalid sentinel + // card rather than panicking. Production shoes always have Decks > + // 0 (Normalize), so this only surfaces a test fixture that drew + // past its script. + return card{rank: "?", suit: "?"} + } // Shuffle-through: if the shoe runs out mid-round it is rebuilt from // all decks, so a card already dealt this round can reappear. This // matches real blackjack, where an exhausted shoe is shuffled through -- cgit v1.2.3