aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/core.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-19 03:15:59 -0400
committerhistoria <[not public]>2026-09-19 03:15:59 -0400
commit0e60567a7a0addb9421769ee7be7853bfa8788cb (patch)
tree7645112db0e4eae95b8a83c1e4f9aab38bede655 /internal/casino/core.go
parentcc33072eced3d5460512c09c42ec4531c807d7af (diff)
downloadthehouseoficarus-0e60567a7a0addb9421769ee7be7853bfa8788cb.tar.gz
refactor: simplifcation, change how rooms are stored in player yaml, remove legacy code
Diffstat (limited to 'internal/casino/core.go')
-rw-r--r--internal/casino/core.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/internal/casino/core.go b/internal/casino/core.go
index 0b9d0af..7143841 100644
--- a/internal/casino/core.go
+++ b/internal/casino/core.go
@@ -143,11 +143,7 @@ func resolveStakeIDs(w Wallet, ids []string) {
if w == nil {
return
}
- for _, id := range ids {
- if id != "" {
- w.ResolveStake(id)
- }
- }
+ w.ResolveStakesByIDs(ids...)
}
// settleStakeOutcome applies one wager's outcome through the wallet and
@@ -175,12 +171,10 @@ func settleStakeOutcome(w Wallet, payout int, stakeIDs []string, payoutErr error
if payout > 0 {
return w.PayCredits(payout, stakeIDs...) != nil
}
- // A zero payout is a loss: consume the stakes so recovery cannot refund a
- // round that resolved.
- for _, id := range stakeIDs {
- if id != "" {
- w.ResolveStake(id)
- }
+ // A zero payout is a loss: consume the stakes in one save so recovery can
+ // never refund a round that resolved.
+ if w != nil {
+ w.ResolveStakesByIDs(stakeIDs...)
}
return false
}