Fix NPC shutdown crash (#2971)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-01-11 01:24:03 +11:00
committed by GitHub
parent 7bfdf30268
commit d403a7fab4
10 changed files with 67 additions and 49 deletions

View File

@@ -21,9 +21,9 @@ namespace Content.Server.AI.Operators.Movement
DesiredRange = desiredRange;
}
public override bool TryStartup()
public override bool Startup()
{
if (!base.TryStartup())
if (!base.Startup())
{
return true;
}
@@ -34,11 +34,14 @@ namespace Content.Server.AI.Operators.Movement
return true;
}
public override void Shutdown(Outcome outcome)
public override bool Shutdown(Outcome outcome)
{
base.Shutdown(outcome);
if (!base.Shutdown(outcome))
return false;
var steering = EntitySystem.Get<AiSteeringSystem>();
steering.Unregister(_owner);
return true;
}
public override Outcome Execute(float frameTime)