aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/baccarat.go
diff options
context:
space:
mode:
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: