]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix adjusting slots on infinite slot jobs (#14154)
authorChief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
Sun, 19 Feb 2023 01:00:38 +0000 (19:00 -0600)
committerGitHub <noreply@github.com>
Sun, 19 Feb 2023 01:00:38 +0000 (19:00 -0600)
* fix TrySetJobSlot() on infinite slot jobs

* use null coalescing operator

* remove !

Content.Server/Station/Systems/StationJobsSystem.cs

index f8dac0688c70b684593312c119647e376d2397ae..268d50739d23255eefdf1e11ecac05068d8e41cd 100644 (file)
@@ -224,7 +224,7 @@ public sealed partial class StationJobsSystem : EntitySystem
                 UpdateJobsAvailable();
                 return true;
             case true:
-                stationJobs.TotalJobs += amount - (int)jobList[jobPrototypeId]!.Value;
+                stationJobs.TotalJobs += amount - (int) (jobList[jobPrototypeId] ?? 0);
 
                 jobList[jobPrototypeId] = (uint)amount;
                 UpdateJobsAvailable();