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

@@ -110,17 +110,18 @@ namespace Content.Server.GameObjects.EntitySystems.AI
foreach (var processor in _awakeAi)
{
if (count >= maxUpdates)
{
break;
}
if (processor.SelfEntity.Deleted)
if (processor.SelfEntity.Deleted ||
!processor.SelfEntity.HasComponent<AiControllerComponent>())
{
toRemove.Add(processor);
continue;
}
if (count >= maxUpdates)
{
break;
}
processor.Update(frameTime);
count++;
}