This commit is contained in:
metalgearsloth
2023-09-11 18:10:07 +10:00
committed by GitHub
parent e1a91466f1
commit 66c4dfaa8e
2 changed files with 20 additions and 8 deletions

View 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>())
{