Remove HTN ComponentReference (#19480)
This commit is contained in:
@@ -8,8 +8,10 @@ using Content.Server.NPC.Components;
|
||||
using Content.Server.NPC.HTN.PrimitiveTasks;
|
||||
using Content.Server.NPC.Systems;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.NPC;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -32,6 +34,10 @@ public sealed class HTNSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<HTNComponent, MobStateChangedEvent>(_npc.OnMobStateChange);
|
||||
SubscribeLocalEvent<HTNComponent, MapInitEvent>(_npc.OnNPCMapInit);
|
||||
SubscribeLocalEvent<HTNComponent, PlayerAttachedEvent>(_npc.OnPlayerNPCAttach);
|
||||
SubscribeLocalEvent<HTNComponent, PlayerDetachedEvent>(_npc.OnPlayerNPCDetach);
|
||||
SubscribeLocalEvent<HTNComponent, ComponentShutdown>(OnHTNShutdown);
|
||||
SubscribeNetworkEvent<RequestHTNMessage>(OnHTNMessage);
|
||||
|
||||
@@ -132,6 +138,7 @@ public sealed class HTNSystem : EntitySystem
|
||||
|
||||
private void OnHTNShutdown(EntityUid uid, HTNComponent component, ComponentShutdown args)
|
||||
{
|
||||
_npc.OnNPCShutdown(uid, component, args);
|
||||
component.PlanningToken?.Cancel();
|
||||
component.PlanningJob = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user