From b09cd1ca8c9cea6710905b58ada9a8e3b40750d2 Mon Sep 17 00:00:00 2001 From: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com> Date: Sun, 19 Jan 2025 22:48:58 +0300 Subject: [PATCH 1/2] Make storage implant drop items on gibbing (#33493) * Make storage implant drop items on gib/removal * Better way * Fix error * Forgotten trash * Cleanup * Unused var * Update Content.Server/Implants/ImplantedSystem.cs Co-authored-by: 0x6273 <0x40@keemail.me> --------- Co-authored-by: Winkarst <74284083+Winkarst-cpu@users.noreply.github.co> Co-authored-by: 0x6273 <0x40@keemail.me> --- Content.Server/Implants/ImplantedSystem.cs | 10 +++++++++- .../Implants/SharedSubdermalImplantSystem.cs | 10 +++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Content.Server/Implants/ImplantedSystem.cs b/Content.Server/Implants/ImplantedSystem.cs index 5d27e6471185..16b2c79d25f4 100644 --- a/Content.Server/Implants/ImplantedSystem.cs +++ b/Content.Server/Implants/ImplantedSystem.cs @@ -1,4 +1,5 @@ -using Content.Shared.Implants.Components; +using Content.Server.Body.Components; +using Content.Shared.Implants.Components; using Robust.Shared.Containers; namespace Content.Server.Implants; @@ -9,6 +10,7 @@ public void InitializeImplanted() { SubscribeLocalEvent(OnImplantedInit); SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnGibbed); } private void OnImplantedInit(EntityUid uid, ImplantedComponent component, ComponentInit args) @@ -22,4 +24,10 @@ private void OnShutdown(EntityUid uid, ImplantedComponent component, ComponentSh //If the entity is deleted, get rid of the implants _container.CleanContainer(component.ImplantContainer); } + + private void OnGibbed(Entity ent, ref BeingGibbedEvent args) + { + //If the entity is gibbed, get rid of the implants + _container.CleanContainer(ent.Comp.ImplantContainer); + } } diff --git a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs index 94203de61558..bb166b3c5cb8 100644 --- a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs +++ b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs @@ -1,4 +1,3 @@ -using System.Linq; using Content.Shared.Actions; using Content.Shared.Implants.Components; using Content.Shared.Interaction; @@ -8,6 +7,7 @@ using JetBrains.Annotations; using Robust.Shared.Containers; using Robust.Shared.Network; +using System.Linq; namespace Content.Shared.Implants; @@ -17,6 +17,7 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedContainerSystem _container = default!; [Dependency] private readonly TagSystem _tag = default!; + [Dependency] private readonly SharedTransformSystem _transformSystem = default!; public const string BaseStorageId = "storagebase"; @@ -75,16 +76,11 @@ private void OnRemove(EntityUid uid, SubdermalImplantComponent component, EntGot if (!_container.TryGetContainer(uid, BaseStorageId, out var storageImplant)) return; - var entCoords = Transform(component.ImplantedEntity.Value).Coordinates; - var containedEntites = storageImplant.ContainedEntities.ToArray(); foreach (var entity in containedEntites) { - if (Terminating(entity)) - continue; - - _container.RemoveEntity(storageImplant.Owner, entity, force: true, destination: entCoords); + _transformSystem.DropNextTo(entity, uid); } } From c0fcf4b93bba180809879c0759b02d80007f7ff5 Mon Sep 17 00:00:00 2001 From: PJBot Date: Sun, 19 Jan 2025 19:50:07 +0000 Subject: [PATCH 2/2] Automatic changelog update --- Resources/Changelog/Changelog.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index e56d6a0fc959..83a166c20bc5 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,12 +1,4 @@ Entries: -- author: deltanedas - changes: - - message: Adjusted the costs and production times of all electronics so they're - more consistent with eachother. - type: Tweak - id: 7331 - time: '2024-09-09T19:34:18.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/31524 - author: Winkarst-cpu changes: - message: Now fire axe (the flaming one), and an advanced circular saw are Syndicate @@ -3913,3 +3905,11 @@ id: 7830 time: '2025-01-19T05:32:34.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/34475 +- author: Winkarst-cpu + changes: + - message: Now items from the storage implant drop on the floor upon gibbing of + the owner. + type: Tweak + id: 7831 + time: '2025-01-19T19:48:58.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/33493