Return new balance when it's modified and use that for display so it accounts for concurrent games

This commit is contained in:
barelyprofessional
2025-12-09 23:40:15 -06:00
parent 5af2015d46
commit 4671bb3d25
6 changed files with 20 additions and 24 deletions
@@ -247,15 +247,13 @@ public class LambchopCommand : ICommand
{
var multi = LambchopPayoutMultiplier(targetTile);
var lambchopPayout = Math.Round(wager * multi - wager, 2);
await Money.NewWagerAsync(gambler.Id, wager, lambchopPayout, WagerGame.LambChop, ct: ctx);
newBalance = gambler.Balance + lambchopPayout;
newBalance = await Money.NewWagerAsync(gambler.Id, wager, lambchopPayout, WagerGame.LambChop, ct: ctx);
lambchopResultMessage = $"{user.FormatUsername()}, you [B][COLOR={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]WON[/COLOR][/B]" +
$" | Multi {multi} | Balance {await newBalance.FormatKasinoCurrencyAsync()}";
}
else
{
await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.LambChop, ct: ctx);
newBalance = gambler.Balance - wager;
newBalance = await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.LambChop, ct: ctx);
lambchopResultMessage = $"{user.FormatUsername()}, you [B][COLOR={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]LOST[/COLOR][/B]" +
$", better luck next time | Balance {await newBalance.FormatKasinoCurrencyAsync()}";