From 478f903bef7bc3a74e138683e98e9047c9df43c5 Mon Sep 17 00:00:00 2001 From: kookroach Date: Sun, 11 Apr 2021 02:06:52 +0200 Subject: [PATCH] fix --- ReallifeGamemode.Server/Job/BusDriverJob.cs | 8 ++++---- ReallifeGamemode.Server/Job/PilotJob.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index fdf96b35..44163ae0 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -294,7 +294,7 @@ namespace ReallifeGamemode.Server.Job public int getPlayerRouteInex(Player player) { if (!playerRouteCurrent.ContainsKey(player.Name)) - return -1; + return 0; List selectedRoute = playerRouteCurrent[player.Name]; @@ -320,7 +320,7 @@ namespace ReallifeGamemode.Server.Job } } - return -1; + return 0; } private uint getPlayerJobVehicle(Player player) @@ -345,7 +345,7 @@ namespace ReallifeGamemode.Server.Job if (type == PROFESSIONAL && user.BusSkill < SKILL_PROFESSIONAL) { player.TriggerEvent("MenuSelect:Error"); return; } List selectedRoute = new List(); - int index = -1; + int index = 0; if (playerRouteCurrent.ContainsKey(player.Name)) { @@ -403,7 +403,7 @@ namespace ReallifeGamemode.Server.Job playerRouteCurrent.Remove(player.Name); playerRouteCurrent.Add(player.Name, selectedRoute); - if (selectedRoute.Count is 0) + if (selectedRoute is null || selectedRoute.Count is 0) { Console.WriteLine($"[ERROR:BUSJOB] Player {player.Name} has empty route Vector3 List."); return; diff --git a/ReallifeGamemode.Server/Job/PilotJob.cs b/ReallifeGamemode.Server/Job/PilotJob.cs index 4eb09396..04d26528 100644 --- a/ReallifeGamemode.Server/Job/PilotJob.cs +++ b/ReallifeGamemode.Server/Job/PilotJob.cs @@ -203,7 +203,7 @@ namespace ReallifeGamemode.Server.Job selectedRoute = ROUTE_INTERMEDIATE.GetValueOrDefault(random.Next(1, ROUTE_INTERMEDIATE.Count)); } - if (selectedRoute.Count is 0) + if (selectedRoute is null || selectedRoute.Count is 0) { Console.WriteLine($"[ERROR:BUSJOB] Player {player.Name} has empty route Vector3 List."); return;