Fix NPC shutdown crash (#2971)
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user