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/credits.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal/casino/credits.go') diff --git a/internal/casino/credits.go b/internal/casino/credits.go index 8b7cb7a..631a4bc 100644 --- a/internal/casino/credits.go +++ b/internal/casino/credits.go @@ -47,6 +47,12 @@ func MulPayout(amount int, multiplier float64) (int, error) { return MaxCredits, fmt.Errorf("payout overflow: %d * %v exceeds %d", amount, multiplier, MaxCredits) } payout := int(math.Floor(float64(amount) * multiplier)) + if payout == 0 && multiplier > 0 { + // A positive stake on a winning outcome must never pay nothing: a + // fractional multiplier (e.g. a 5% baccarat commission) at a 1-credit + // bet floors to zero, turning a win into a total loss. + payout = 1 + } if payout > MaxCredits { return MaxCredits, fmt.Errorf("payout overflow: %d * %v exceeds %d", amount, multiplier, MaxCredits) } -- cgit v1.2.3