krash fix hopefuly (#105)

* Update KrashCommand.cs

add wager limit

* Update KasinoKrash.cs

* actual fix for payout

found the bug it was using the game multi instead of the bet multi

* Update KrashCommand.cs

remove wager limit

* actually fix the actual bug

fix the actual bug
This commit is contained in:
A Log in D Tractor
2026-04-09 17:51:47 -07:00
committed by GitHub
parent 64e318ce84
commit 354b1cfd99
2 changed files with 14 additions and 4 deletions

View File

@@ -75,10 +75,11 @@ public class KasinoKrash : IDisposable
var krashBet = TheGame.Bets[index];
TheGame.Bets.RemoveAt(index);
var payout = TheGame.CurrentMulti * krashBet.Wager - krashBet.Wager;
var multi = TheGame.CurrentMulti;
var payout = multi * krashBet.Wager - krashBet.Wager;
var newBalance = await Money.NewWagerAsync(krashBet.Gambler.Id, krashBet.Wager, payout, WagerGame.Krash, ct: _ct);
await _kfChatBot.SendChatMessageAsync(
$"{krashBet.Gambler.User.FormatUsername()}, you [color=limegreen][b]won[/b][/color] {await payout.FormatKasinoCurrencyAsync()}!",
$"{krashBet.Gambler.User.FormatUsername()}, you [color=limegreen][b]won[/b][/color] {await payout.FormatKasinoCurrencyAsync()} by cashing out the krash at {multi}x!",
true, autoDeleteAfter: TimeSpan.FromSeconds(10));
if (_kfChatBot.BotServices.KasinoShop != null)
{
@@ -182,7 +183,7 @@ public class KasinoKrash : IDisposable
if (bet.Multi <= TheGame.FinalMulti && bet.Multi != -1)
{
//you win
var payout = TheGame.CurrentMulti * bet.Wager - bet.Wager;
var payout = bet.Multi * bet.Wager - bet.Wager;
var newBalance = await Money.NewWagerAsync(bet.Gambler.Id, bet.Wager, payout, WagerGame.Krash, ct: _ct);
await _kfChatBot.SendChatMessageAsync(
$"{bet.Gambler.User.FormatUsername()}, you [color=limegreen][b]won[/b][/color] {await payout.FormatKasinoCurrencyAsync()}!",