Fix balance display on win

This commit is contained in:
barelyprofessional
2026-01-05 00:32:45 -06:00
parent 9077e629be
commit 1c8a2658ca

View File

@@ -447,7 +447,7 @@ public class BlackjackCommand : ICommand
wager.Multiplier = multiplier; wager.Multiplier = multiplier;
await _dbContext.SaveChangesAsync(ctx); await _dbContext.SaveChangesAsync(ctx);
var balanceAdjustment = finalEffect + wager.WagerAmount; var balanceAdjustment = finalEffect + wager.WagerAmount;
await Money.ModifyBalanceAsync(gambler.Id, balanceAdjustment, TransactionSourceEventType.Gambling, var newBalance = await Money.ModifyBalanceAsync(gambler.Id, balanceAdjustment, TransactionSourceEventType.Gambling,
$"Blackjack outcome from wager {wager.Id}", null, ctx); $"Blackjack outcome from wager {wager.Id}", null, ctx);
// Display result // Display result
@@ -465,7 +465,7 @@ public class BlackjackCommand : ICommand
message += $"You lost {await Math.Abs(finalEffect).FormatKasinoCurrencyAsync()}! "; message += $"You lost {await Math.Abs(finalEffect).FormatKasinoCurrencyAsync()}! ";
} }
message += $"Balance: {await gambler.Balance.FormatKasinoCurrencyAsync()}"; message += $"Balance: {await newBalance.FormatKasinoCurrencyAsync()}";
await botInstance.SendChatMessageAsync(message, true, autoDeleteAfter: cleanupDelay); await botInstance.SendChatMessageAsync(message, true, autoDeleteAfter: cleanupDelay);
} }