]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Death acidifier fix (#25251)
authorJezithyr <jezithyr@gmail.com>
Thu, 15 Feb 2024 01:37:56 +0000 (17:37 -0800)
committerGitHub <noreply@github.com>
Thu, 15 Feb 2024 01:37:56 +0000 (17:37 -0800)
Content.Server/Body/Systems/BodySystem.cs
Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Content.Shared/Body/Systems/SharedBodySystem.Body.cs

index 0e9b295f718d044b8854cab7e4b7f3105cbc2d64..18119909abce0dda854354c5e7ac51b562fe51fa 100644 (file)
@@ -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<EntityUid>();
 
-        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);
index aa81f80c501148a7af2f4b53b6647773509df415..5830018c4887e408772944148f75cd6a49103539 100644 (file)
@@ -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<TransformComponent>(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;
         }
 
index 85b6758d78a1aa2068c2c4e3f3fce90d1e58625a..bc7cf63124c30689e7aaf6cbf375d45b3ae30225 100644 (file)
@@ -274,8 +274,7 @@ public partial class SharedBodySystem
     public virtual HashSet<EntityUid> GibBody(
         EntityUid bodyId,
         bool gibOrgans = false,
-        BodyComponent? body = null ,
-        bool deleteItems = false,
+        BodyComponent? body = null,
         bool launchGibs = true,
         Vector2? splatDirection = null,
         float splatModifier = 1,