Skip to content

Commit

Permalink
HOTFIX: fix minibomb implant and syndicats not exploding (space-wizar…
Browse files Browse the repository at this point in the history
…ds#34923)

fix minibomb implant not exploding
  • Loading branch information
slarticodefast authored and FluffMe committed Feb 8, 2025
1 parent 8d29c8f commit 6d3f8ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Content.Server/Implants/ImplantedSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.Body.Components;
using Content.Shared.Implants.Components;
using Content.Shared.Storage;
using Robust.Shared.Containers;

namespace Content.Server.Implants;
Expand All @@ -13,21 +14,26 @@ public void InitializeImplanted()
SubscribeLocalEvent<ImplantedComponent, BeingGibbedEvent>(OnGibbed);
}

private void OnImplantedInit(EntityUid uid, ImplantedComponent component, ComponentInit args)
private void OnImplantedInit(Entity<ImplantedComponent> ent, ref ComponentInit args)
{
component.ImplantContainer = _container.EnsureContainer<Container>(uid, ImplanterComponent.ImplantSlotId);
component.ImplantContainer.OccludesLight = false;
ent.Comp.ImplantContainer = _container.EnsureContainer<Container>(ent.Owner, ImplanterComponent.ImplantSlotId);
ent.Comp.ImplantContainer.OccludesLight = false;
}

private void OnShutdown(EntityUid uid, ImplantedComponent component, ComponentShutdown args)
private void OnShutdown(Entity<ImplantedComponent> ent, ref ComponentShutdown args)
{
//If the entity is deleted, get rid of the implants
_container.CleanContainer(component.ImplantContainer);
_container.CleanContainer(ent.Comp.ImplantContainer);
}

private void OnGibbed(Entity<ImplantedComponent> ent, ref BeingGibbedEvent args)
{
//If the entity is gibbed, get rid of the implants
_container.CleanContainer(ent.Comp.ImplantContainer);
// Drop the storage implant contents before the implants are deleted by the body being gibbed
foreach (var implant in ent.Comp.ImplantContainer.ContainedEntities)
{
if (TryComp<StorageComponent>(implant, out var storage))
_container.EmptyContainer(storage.Container, destination: Transform(ent).Coordinates);
}

}
}
1 change: 1 addition & 0 deletions Content.Shared/Implants/Components/ImplantedComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ namespace Content.Shared.Implants.Components;
[RegisterComponent, NetworkedComponent]
public sealed partial class ImplantedComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public Container ImplantContainer = default!;
}

0 comments on commit 6d3f8ac

Please sign in to comment.