diff options
Diffstat (limited to 'internal/casino/machine.go')
| -rw-r--r-- | internal/casino/machine.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/casino/machine.go b/internal/casino/machine.go index 36576d0..aad6352 100644 --- a/internal/casino/machine.go +++ b/internal/casino/machine.go @@ -272,7 +272,6 @@ func (m *Machine) finishSpin() []Event { payNow = 0 case featureEnds: payNow = credits + int(m.featureBank) - m.featureBank = 0 } payFailed := false @@ -290,8 +289,21 @@ func (m *Machine) finishSpin() []Event { failedEvents := m.private(payoutFailedMessage()) failedEvents[0].Color = "casino_payout" events = append(events, failedEvents...) + if featureEnds && int(m.featureBank) > 0 { + bankEvents := m.private("The house could not credit your banked free-spin winnings either; they stay banked and are paid with your next completed free-spin feature, or when the casino closes.") + bankEvents[0].Color = "casino_action" + events = append(events, bankEvents...) + } } } + if featureEnds && !payFailed { + // The bank is now part of the settled (or absent-wallet) payout. It is + // cleared only once the save succeeded, so a failed settlement leaves + // the banked winnings on the machine instead of destroying them: the + // next free-spin feature pays them again, and shutdown/refund paths + // (refundAll, markDisconnected) still settle or report them. + m.featureBank = 0 + } if payNow > 0 && !payFailed { message := fmt.Sprintf("\nYou win %d credits.", payNow) switch { |
