From 7e131ff1a4e6523997038ee16efa91251912db60 Mon Sep 17 00:00:00 2001 From: alogindtractor <251821224+A-Log-In-D-Tractor@users.noreply.github.com> Date: Tue, 7 Apr 2026 21:39:06 -0700 Subject: [PATCH] Fix bet handling and payout calculations in Krash game (#103) fix where it would let you win if you didn't attempt to krash also keeps message on screen a little longer after its over so you can see the final number better --- KfChatDotNetBot/Services/KasinoKrash.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/KfChatDotNetBot/Services/KasinoKrash.cs b/KfChatDotNetBot/Services/KasinoKrash.cs index 675b324..8667413 100644 --- a/KfChatDotNetBot/Services/KasinoKrash.cs +++ b/KfChatDotNetBot/Services/KasinoKrash.cs @@ -72,7 +72,7 @@ public class KasinoKrash : IDisposable //find which bet is yours var index = TheGame.Bets.TakeWhile(bet => bet.Gambler.User.KfId != gambler.User.KfId).Count(); - + var krashBet = TheGame.Bets[index]; TheGame.Bets.RemoveAt(index); var payout = TheGame.CurrentMulti * krashBet.Wager - krashBet.Wager; @@ -162,7 +162,7 @@ public class KasinoKrash : IDisposable await _kfChatBot.KfClient.EditMessageAsync(msg.ChatMessageUuid!, $"[center][b][size=200][color=red]{TheGame.FinalMulti}x"); foreach (var bet in TheGame.Bets) { - if (bet.Multi <= TheGame.FinalMulti) + if (bet.Multi <= TheGame.FinalMulti && bet.Multi != -1) { //you win var payout = TheGame.CurrentMulti * bet.Wager - bet.Wager; @@ -192,6 +192,7 @@ public class KasinoKrash : IDisposable } //now close the game + await Task.Delay(5000); await _kfChatBot.KfClient.DeleteMessageAsync(msg.ChatMessageUuid!); await RemoveKrashState(); }