From ecca103970f58525fe9375406add8122578d4922 Mon Sep 17 00:00:00 2001 From: hydrant Date: Thu, 15 Apr 2021 00:15:51 +0200 Subject: [PATCH] [HOTFIX] fix medic heal task server crash --- ReallifeGamemode.Server/Events/Death.cs | 3 ++- ReallifeGamemode.Server/Factions/Medic/Medic.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Events/Death.cs b/ReallifeGamemode.Server/Events/Death.cs index c810c4ff..afcd7ad6 100644 --- a/ReallifeGamemode.Server/Events/Death.cs +++ b/ReallifeGamemode.Server/Events/Death.cs @@ -94,6 +94,8 @@ namespace ReallifeGamemode.Server.Events } } + Medic.delHealTask(player); + if (user.JailTime <= 0) { user.Dead = true; @@ -113,7 +115,6 @@ namespace ReallifeGamemode.Server.Events MedicName = "none" }; Medic.AddTaskToList(reviveTask); - Medic.delHealTask(player); ChatService.BroadcastFaction("~y~[MEDIC] ~w~" + player.Name + " ist soeben verstorben.", new List() { 2 }); } diff --git a/ReallifeGamemode.Server/Factions/Medic/Medic.cs b/ReallifeGamemode.Server/Factions/Medic/Medic.cs index 7bb2fd2d..f5c27650 100644 --- a/ReallifeGamemode.Server/Factions/Medic/Medic.cs +++ b/ReallifeGamemode.Server/Factions/Medic/Medic.cs @@ -263,7 +263,7 @@ namespace ReallifeGamemode.Server.Factions.Medic { player.SetData("healauftrag", false); var medicPlayer = PlayerService.GetPlayerByNameOrId(task.MedicName); - if (task.MedicName != "none") + if (medicPlayer != null) { medicPlayer.TriggerEvent("destroyMedicTaskCheckpoint"); }