From 3657e16937c1f2f74557fdd886d1ac060c72ad80 Mon Sep 17 00:00:00 2001 From: keronshb <54602815+keronshb@users.noreply.github.com> Date: Sat, 24 Dec 2022 16:34:11 -0500 Subject: [PATCH] Fixes a subdermal exception (#13145) * fixes subdermal exception * Changes linq check to a foreach loop to remove the entities, also moves TODO note to containersystem * comment to push change * removes dummy comment --- .../Implants/SharedSubdermalImplantSystem.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs index 58ec2348a2..acdae85da1 100644 --- a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs +++ b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs @@ -1,4 +1,5 @@ -using Content.Shared.Actions; +using System.Linq; +using Content.Shared.Actions; using Content.Shared.Actions.ActionTypes; using Content.Shared.Implants.Components; using Content.Shared.Tag; @@ -67,8 +68,15 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem var entCoords = Transform(component.ImplantedEntity.Value).Coordinates; - // TODO add variant of empty container that dumpes entities into parent containers OR grid OR Map - _container.EmptyContainer(storageImplant, true, entCoords, true, EntityManager); + var containedEntites = storageImplant.ContainedEntities.ToArray(); + + foreach (var entity in containedEntites) + { + if (Terminating(entity)) + continue; + + _container.RemoveEntity(storageImplant.Owner, entity, force: true, destination: entCoords); + } } ///