Use ECS prototype-reload events (#22613)
* Use ECS prototype-reload events * better constructors * Maybe this fixes tests?
This commit is contained in:
@@ -22,19 +22,14 @@ public abstract class SharedJobSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
_protoManager.PrototypesReloaded += OnProtoReload;
|
||||
SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnProtoReload);
|
||||
SetupTrackerLookup();
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
_protoManager.PrototypesReloaded -= OnProtoReload;
|
||||
}
|
||||
|
||||
private void OnProtoReload(PrototypesReloadedEventArgs obj)
|
||||
{
|
||||
SetupTrackerLookup();
|
||||
if (obj.WasModified<JobPrototype>())
|
||||
SetupTrackerLookup();
|
||||
}
|
||||
|
||||
private void SetupTrackerLookup()
|
||||
|
||||
Reference in New Issue
Block a user