Use ECS prototype-reload events (#22613)
* Use ECS prototype-reload events * better constructors * Maybe this fixes tests?
This commit is contained in:
@@ -28,9 +28,9 @@ public sealed class NameIdentifierSystem : EntitySystem
|
||||
SubscribeLocalEvent<NameIdentifierComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<NameIdentifierComponent, ComponentShutdown>(OnComponentShutdown);
|
||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(CleanupIds);
|
||||
SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnReloadPrototypes);
|
||||
|
||||
InitialSetupPrototypes();
|
||||
_prototypeManager.PrototypesReloaded += OnReloadPrototypes;
|
||||
}
|
||||
|
||||
private void OnComponentShutdown(EntityUid uid, NameIdentifierComponent component, ComponentShutdown args)
|
||||
@@ -46,13 +46,6 @@ public sealed class NameIdentifierSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
|
||||
_prototypeManager.PrototypesReloaded -= OnReloadPrototypes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates a new unique name/suffix for a given entity and adds it to <see cref="CurrentIds"/>
|
||||
/// but does not set the entity's name.
|
||||
|
||||
Reference in New Issue
Block a user