From be29a054de37b54d7c0a09c75b6fded91374341a Mon Sep 17 00:00:00 2001 From: Jezithyr Date: Wed, 14 Feb 2024 17:37:56 -0800 Subject: [PATCH] Death acidifier fix (#25251) --- Content.Server/Body/Systems/BodySystem.cs | 3 +-- .../Explosion/EntitySystems/TriggerSystem.cs | 14 +++++++++++--- .../Body/Systems/SharedBodySystem.Body.cs | 3 +-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Content.Server/Body/Systems/BodySystem.cs b/Content.Server/Body/Systems/BodySystem.cs index 0e9b295f71..18119909ab 100644 --- a/Content.Server/Body/Systems/BodySystem.cs +++ b/Content.Server/Body/Systems/BodySystem.cs @@ -111,7 +111,6 @@ public sealed class BodySystem : SharedBodySystem EntityUid bodyId, bool gibOrgans = false, BodyComponent? body = null , - bool deleteItems = false, bool launchGibs = true, Vector2? splatDirection = null, float splatModifier = 1, @@ -129,7 +128,7 @@ public sealed class BodySystem : SharedBodySystem if (xform.MapUid == null) return new HashSet(); - var gibs = base.GibBody(bodyId, gibOrgans, body, deleteItems, launchGibs: launchGibs, + var gibs = base.GibBody(bodyId, gibOrgans, body, launchGibs: launchGibs, splatDirection: splatDirection, splatModifier: splatModifier, splatCone:splatCone); RaiseLocalEvent(bodyId, new BeingGibbedEvent(gibs)); QueueDel(bodyId); diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index aa81f80c50..5830018c48 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -12,6 +12,7 @@ using Content.Shared.Explosion.Components; using Content.Shared.Explosion.Components.OnTrigger; using Content.Shared.Implants.Components; using Content.Shared.Interaction; +using Content.Shared.Inventory; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; using Content.Shared.Payload.Components; @@ -68,6 +69,7 @@ namespace Content.Server.Explosion.EntitySystems [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; + [Dependency] private readonly InventorySystem _inventory = default!; public override void Initialize() { @@ -154,9 +156,15 @@ namespace Content.Server.Explosion.EntitySystems { if (!TryComp(uid, out var xform)) return; - - _body.GibBody(xform.ParentUid, true, deleteItems: component.DeleteItems); - + if (component.DeleteItems) + { + var items = _inventory.GetHandOrInventoryEntities(xform.ParentUid); + foreach (var item in items) + { + Del(item); + } + } + _body.GibBody(xform.ParentUid, true); args.Handled = true; } diff --git a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs index 85b6758d78..bc7cf63124 100644 --- a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs +++ b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs @@ -274,8 +274,7 @@ public partial class SharedBodySystem public virtual HashSet GibBody( EntityUid bodyId, bool gibOrgans = false, - BodyComponent? body = null , - bool deleteItems = false, + BodyComponent? body = null, bool launchGibs = true, Vector2? splatDirection = null, float splatModifier = 1,