From b544098af8da0a1b82b838bc17847251d2531896 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 28 Nov 2022 15:33:19 +1300 Subject: [PATCH] fix body gibbing exception (#12787) --- Content.Server/Body/Systems/BodySystem.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/Body/Systems/BodySystem.cs b/Content.Server/Body/Systems/BodySystem.cs index cdd3089972..6432d603b1 100644 --- a/Content.Server/Body/Systems/BodySystem.cs +++ b/Content.Server/Body/Systems/BodySystem.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using System.Linq; using Content.Server.Body.Components; using Content.Server.GameTicking; using Content.Server.Humanoid; @@ -146,9 +147,9 @@ public sealed class BodySystem : SharedBodySystem if (TryComp(bodyId, out ContainerManagerComponent? container)) { - foreach (var cont in container.GetAllContainers()) + foreach (var cont in container.GetAllContainers().ToArray()) { - foreach (var ent in cont.ContainedEntities) + foreach (var ent in cont.ContainedEntities.ToArray()) { if (deleteItems) {