aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/baccarat.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 16:13:49 -0400
committerhistoria <[not public]>2026-09-18 16:13:49 -0400
commit194164a77eb4f2479b94c19e6f0e1278ab608781 (patch)
tree53413add8ed6f32a34d1733397e380cc98ef70ef /internal/casino/baccarat.go
parent67e01aab85607b9e601185c7d62dff576af3bb43 (diff)
downloadthehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/casino/baccarat.go')
-rw-r--r--internal/casino/baccarat.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/casino/baccarat.go b/internal/casino/baccarat.go
index 231a011..c9a50a1 100644
--- a/internal/casino/baccarat.go
+++ b/internal/casino/baccarat.go
@@ -369,6 +369,16 @@ func settleBaccaratBet(spot string, bet int, playerTotal, bankerTotal int, rules
case bankerTotal > playerTotal:
if spot == baccaratSpotBanker {
bankerWin, _ := MulPayout(bet, rules.BankerPayout)
+ // The banker commission rounds UP, not down: when the wager is
+ // too small for a whole credit of commission, a winning banker
+ // bet returns only the stake. MulPayout's positive-stake floor
+ // would otherwise round the commission to zero and make the
+ // banker bet +EV (it wins more often than it loses, and ties
+ // push), which the "never bet less than one commission unit"
+ // rule exists to prevent.
+ if float64(bet)*rules.BankerPayout < 1 {
+ return "push", bet
+ }
return "win", bet + bankerWin
}
default: