EntityUid bodyId,
bool gibOrgans = false,
BodyComponent? body = null ,
- bool deleteItems = false,
bool launchGibs = true,
Vector2? splatDirection = null,
float splatModifier = 1,
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);
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;
[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()
{
{
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;
}
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,