From 9ac0a15d13c4ab1a979e2954865df6ce6a96578b Mon Sep 17 00:00:00 2001 From: VegaZ Date: Mon, 5 Apr 2021 15:07:13 +0200 Subject: [PATCH] Fix Revive not setting DB --- ReallifeGamemode.Server/Commands/FactionCommands.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index 4d760f2c..c2fbe406 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -323,11 +323,7 @@ namespace ReallifeGamemode.Server.Commands deadPlayerUser.Handmoney = 0; deadPlayerUser.BankAccount.Balance -= bankMoney; } - - dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 2).First().BankAccount.Balance += Medic.ReviveIncome; - - dbContext.SaveChanges(); - + player.PlayAnimation("amb@medic@standing@kneel@enter", "enter", 0); deadPlayer.TriggerEvent("onPlayerRevived"); @@ -335,7 +331,9 @@ namespace ReallifeGamemode.Server.Commands deadPlayer.SendNotification($"Du wurdest von ~y~{player.Name}~s~ für ~g~{100.ToMoneyString()} ~s~wiederbelebt."); player.SendNotification($"Du hast ~y~{deadPlayer.Name}~s~ wiederbelebt und ~g~{Medic.ReviveIncome}$ ~s~für die Fraktion verdient."); deadPlayer.SetData("isDead", false); - + + dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 2).First().BankAccount.Balance += Medic.ReviveIncome; + User u; u = deadPlayer.GetUser(dbContext); u.Dead = false;