[HOTFIX] fix medic heal task server crash

This commit is contained in:
hydrant
2021-04-15 00:15:51 +02:00
parent 1ddb5164ff
commit ecca103970
2 changed files with 3 additions and 2 deletions

View File

@@ -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<int>() { 2 });
}

View File

@@ -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");
}