diff options
| author | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-19 03:15:59 -0400 |
| commit | 0e60567a7a0addb9421769ee7be7853bfa8788cb (patch) | |
| tree | 7645112db0e4eae95b8a83c1e4f9aab38bede655 /internal/casino/core.go | |
| parent | cc33072eced3d5460512c09c42ec4531c807d7af (diff) | |
| download | thehouseoficarus-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.go | 16 |
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 } |
