Fix post-mapinit NPC exception (#40244)
Ensure `NPCBlackboard.Owner` is set during startup
This commit is contained in:
@@ -24,6 +24,7 @@ public sealed partial class HTNComponent : NPCComponent
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public HTNPlan? Plan;
|
||||
// TODO FULL GAME SAVE serialize this?
|
||||
|
||||
/// <summary>
|
||||
/// How long to wait after having planned to try planning again.
|
||||
|
||||
@@ -33,6 +33,7 @@ public sealed class HTNSystem : EntitySystem
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<HTNComponent, MobStateChangedEvent>(_npc.OnMobStateChange);
|
||||
SubscribeLocalEvent<HTNComponent, MapInitEvent>(_npc.OnNPCMapInit);
|
||||
SubscribeLocalEvent<HTNComponent, ComponentStartup>(_npc.OnNPCStartup);
|
||||
SubscribeLocalEvent<HTNComponent, PlayerAttachedEvent>(_npc.OnPlayerNPCAttach);
|
||||
SubscribeLocalEvent<HTNComponent, PlayerDetachedEvent>(_npc.OnPlayerNPCDetach);
|
||||
SubscribeLocalEvent<HTNComponent, ComponentShutdown>(OnHTNShutdown);
|
||||
|
||||
Reference in New Issue
Block a user