]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix tests (#20017)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Mon, 11 Sep 2023 08:10:07 +0000 (18:10 +1000)
committerGitHub <noreply@github.com>
Mon, 11 Sep 2023 08:10:07 +0000 (18:10 +1000)
Content.IntegrationTests/Tests/Station/StationJobsTest.cs
Content.Shared/Roles/Jobs/SharedJobSystem.cs

index 1748e944e7102840be086d2076233733fa9db6d3..0085472c33cc31e5909c1ab4b027150529efa734 100644 (file)
@@ -21,7 +21,19 @@ public sealed class StationJobsTest
     [TestPrototypes]
     private const string Prototypes = @"
 - type: playTimeTracker
-  id: PlayTimeDummy
+  id: PlayTimeDummyAssistant
+
+- type: playTimeTracker
+  id: PlayTimeDummyMime
+
+- type: playTimeTracker
+  id: PlayTimeDummyClown
+
+- type: playTimeTracker
+  id: PlayTimeDummyCaptain
+
+- type: playTimeTracker
+  id: PlayTimeDummyChaplain
 
 - type: gameMap
   id: FooStation
@@ -44,26 +56,26 @@ public sealed class StationJobsTest
 
 - type: job
   id: TAssistant
-  playTimeTracker: PlayTimeDummy
+  playTimeTracker: PlayTimeDummyAssistant
 
 - type: job
   id: TMime
   weight: 20
-  playTimeTracker: PlayTimeDummy
+  playTimeTracker: PlayTimeDummyMime
 
 - type: job
   id: TClown
   weight: -10
-  playTimeTracker: PlayTimeDummy
+  playTimeTracker: PlayTimeDummyClown
 
 - type: job
   id: TCaptain
   weight: 10
-  playTimeTracker: PlayTimeDummy
+  playTimeTracker: PlayTimeDummyCaptain
 
 - type: job
   id: TChaplain
-  playTimeTracker: PlayTimeDummy
+  playTimeTracker: PlayTimeDummyChaplain
 ";
 
     private const int StationCount = 100;
index 6ab5776a77e74fed6b860b87434901bddd629594..ac18d04e9c70f0dba7693663bbb4b61fca3dd9d5 100644 (file)
@@ -30,17 +30,17 @@ public abstract class SharedJobSystem : EntitySystem
     {
         base.Shutdown();
         _protoManager.PrototypesReloaded -= OnProtoReload;
-        _inverseTrackerLookup.Clear();
     }
 
     private void OnProtoReload(PrototypesReloadedEventArgs obj)
     {
-        _inverseTrackerLookup.Clear();
         SetupTrackerLookup();
     }
 
     private void SetupTrackerLookup()
     {
+        _inverseTrackerLookup.Clear();
+
         // This breaks if you have N trackers to 1 JobId but future concern.
         foreach (var job in _protoManager.EnumeratePrototypes<JobPrototype>())
         {