Use ECS prototype-reload events (#22613)
* Use ECS prototype-reload events * better constructors * Maybe this fixes tests?
This commit is contained in:
@@ -10,7 +10,6 @@ using Content.Shared.Administration;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.NPC;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -38,8 +37,7 @@ public sealed class HTNSystem : EntitySystem
|
||||
SubscribeLocalEvent<HTNComponent, PlayerDetachedEvent>(_npc.OnPlayerNPCDetach);
|
||||
SubscribeLocalEvent<HTNComponent, ComponentShutdown>(OnHTNShutdown);
|
||||
SubscribeNetworkEvent<RequestHTNMessage>(OnHTNMessage);
|
||||
|
||||
_prototypeManager.PrototypesReloaded += OnPrototypeLoad;
|
||||
SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnPrototypeLoad);
|
||||
OnLoad();
|
||||
}
|
||||
|
||||
@@ -57,12 +55,6 @@ public sealed class HTNSystem : EntitySystem
|
||||
_subscribers.Remove(args.SenderSession);
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
_prototypeManager.PrototypesReloaded -= OnPrototypeLoad;
|
||||
}
|
||||
|
||||
private void OnLoad()
|
||||
{
|
||||
// Clear all NPCs in case they're hanging onto stale tasks
|
||||
|
||||
Reference in New Issue
Block a user