]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix inventory contents not being dropped on gibbing (#42504)
authorpathetic meowmeow <uhhadd@gmail.com>
Sun, 18 Jan 2026 21:08:15 +0000 (16:08 -0500)
committerGitHub <noreply@github.com>
Sun, 18 Jan 2026 21:08:15 +0000 (21:08 +0000)
Content.Shared/Inventory/InventorySystem.Equip.cs

index f12eb8a210d398d814ff09a0cbe9f40409504eb3..1541f90e6a53011ac4286e6eb59e54f2a592ea5e 100644 (file)
@@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Armor;
 using Content.Shared.Clothing.Components;
 using Content.Shared.DoAfter;
+using Content.Shared.Gibbing;
 using Content.Shared.Hands;
 using Content.Shared.Hands.Components;
 using Content.Shared.Hands.EntitySystems;
@@ -43,6 +44,8 @@ public abstract partial class InventorySystem
         SubscribeLocalEvent<InventoryComponent, EntRemovedFromContainerMessage>(OnEntRemoved);
 
         SubscribeAllEvent<UseSlotNetworkMessage>(OnUseSlot);
+
+        SubscribeLocalEvent<InventoryComponent, BeingGibbedEvent>(OnBeingGibbed);
     }
 
     private void OnEntRemoved(EntityUid uid, InventoryComponent component, EntRemovedFromContainerMessage args)
@@ -562,4 +565,12 @@ public abstract partial class InventorySystem
             _interactionSystem.DoContactInteraction(uid, item);
         }
     }
+
+    private void OnBeingGibbed(Entity<InventoryComponent> ent, ref BeingGibbedEvent args)
+    {
+        foreach (var item in GetHandOrInventoryEntities((ent, null, ent)))
+        {
+            args.Giblets.Add(item);
+        }
+    }
 }