From c6abeda53b99e0d8d7a0457b0fd771fa6eb04674 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 20 Aug 2020 21:47:20 +1000 Subject: [PATCH] Fix AI inventory deleted exc (#1810) Was throwing during eating / drinking. Co-authored-by: Metal Gear Sloth --- .../AI/WorldState/States/Inventory/InventoryState.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Content.Server/AI/WorldState/States/Inventory/InventoryState.cs b/Content.Server/AI/WorldState/States/Inventory/InventoryState.cs index 3f570d58bd..8f9701a9ee 100644 --- a/Content.Server/AI/WorldState/States/Inventory/InventoryState.cs +++ b/Content.Server/AI/WorldState/States/Inventory/InventoryState.cs @@ -16,6 +16,9 @@ namespace Content.Server.AI.WorldState.States.Inventory { foreach (var item in handsComponent.GetAllHeldItems()) { + if (item.Owner.Deleted) + continue; + yield return item.Owner; } }