Skip to content

Commit

Permalink
Death acidifier fix (space-wizards#25251)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezithyr authored Feb 15, 2024
1 parent d613942 commit be29a05
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public override HashSet<EntityUid> GibBody(
EntityUid bodyId,
bool gibOrgans = false,
BodyComponent? body = null ,
bool deleteItems = false,
bool launchGibs = true,
Vector2? splatDirection = null,
float splatModifier = 1,
Expand All @@ -129,7 +128,7 @@ public override HashSet<EntityUid> GibBody(
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);
Expand Down
14 changes: 11 additions & 3 deletions Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;
Expand Down Expand Up @@ -68,6 +69,7 @@ public sealed partial class TriggerSystem : EntitySystem
[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()
{
Expand Down Expand Up @@ -154,9 +156,15 @@ private void HandleGibTrigger(EntityUid uid, GibOnTriggerComponent component, Tr
{
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;
}

Expand Down
3 changes: 1 addition & 2 deletions Content.Shared/Body/Systems/SharedBodySystem.Body.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ public IEnumerable<BodyPartSlot> GetBodyAllSlots(EntityUid bodyId, BodyComponent
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,
Expand Down

0 comments on commit be29a05

Please sign in to comment.