diff --git a/Content.IntegrationTests/Tests/Station/StationJobsTest.cs b/Content.IntegrationTests/Tests/Station/StationJobsTest.cs index 1748e944e7..0085472c33 100644 --- a/Content.IntegrationTests/Tests/Station/StationJobsTest.cs +++ b/Content.IntegrationTests/Tests/Station/StationJobsTest.cs @@ -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; diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs index 6ab5776a77..ac18d04e9c 100644 --- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs +++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs @@ -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()) {