From fd99e6b91631b1f001f1e88b91be1f25603d55e4 Mon Sep 17 00:00:00 2001 From: balbo Date: Thu, 6 Aug 2020 20:02:35 +0200 Subject: [PATCH] schulung von drant --- ReallifeGamemode.Server/Events/Disconnect.cs | 10 ++++++---- ReallifeGamemode.Server/Factions/Medic/Medic.cs | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ReallifeGamemode.Server/Events/Disconnect.cs b/ReallifeGamemode.Server/Events/Disconnect.cs index bd0ab631..b281887e 100644 --- a/ReallifeGamemode.Server/Events/Disconnect.cs +++ b/ReallifeGamemode.Server/Events/Disconnect.cs @@ -54,13 +54,15 @@ namespace ReallifeGamemode.Server.Events } TaxiDriverJob taxiJob = JobManager.GetJob(); - TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).First(); + TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault(); - if (taxiJob.TaxiContracts.Contains(taxiContract)) + if (taxiContract != null) { - taxiJob.TaxiContracts.Remove(taxiContract); + if (taxiJob.TaxiContracts.Contains(taxiContract)) + { + taxiJob.TaxiContracts.Remove(taxiContract); + } } - var listReports = Report.Report.listReports; ReportManage temp; for (int a = 0; a < listReports.Count; a++) diff --git a/ReallifeGamemode.Server/Factions/Medic/Medic.cs b/ReallifeGamemode.Server/Factions/Medic/Medic.cs index 70f74fb4..519a2d60 100644 --- a/ReallifeGamemode.Server/Factions/Medic/Medic.cs +++ b/ReallifeGamemode.Server/Factions/Medic/Medic.cs @@ -85,8 +85,6 @@ namespace ReallifeGamemode.Server.Factions.Medic [RemoteEvent("updateMedicTask")] public void UpdateMedicTasks(Player player, int type, int index, string medicName) { - - switch (type) { case 0: