From 80ba7bee6b6512ebfdc793315d8c123e25ff4316 Mon Sep 17 00:00:00 2001 From: FN Date: Fri, 15 Nov 2024 11:42:03 +0700 Subject: [PATCH] Implant fix --- .../Systems/ThiefUndeterminedBackpackSystem.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs b/Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs index 3248a6b9c80..dfc32e090bf 100644 --- a/Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs +++ b/Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs @@ -4,6 +4,7 @@ using Robust.Server.GameObjects; using Robust.Server.Audio; using Robust.Shared.Prototypes; +using Content.Shared.Implants.Components; namespace Content.Server.Thief.Systems; @@ -34,6 +35,13 @@ private void OnUIOpened(Entity backpack, ref private void OnApprove(Entity backpack, ref ThiefBackpackApproveMessage args) { + // Corvax-Next-Api-Start + var entity = backpack.Owner; + + if (TryComp(Transform(entity).ParentUid, out var implant) && implant.ImplantedEntity is not null) + entity = implant.ImplantedEntity.Value; + // Corvax-Next-Api-End + if (backpack.Comp.SelectedSets.Count != backpack.Comp.MaxSelectedSets) return; @@ -42,12 +50,12 @@ private void OnApprove(Entity backpack, ref var set = _proto.Index(backpack.Comp.PossibleSets[i]); foreach (var item in set.Content) { - var ent = Spawn(item, _transform.GetMapCoordinates(backpack.Owner)); + var ent = Spawn(item, _transform.GetMapCoordinates(entity)); // Corvax-Next-Api if (TryComp(ent, out var itemComponent)) - _transform.DropNextTo(ent, backpack.Owner); + _transform.DropNextTo(ent, entity); // Corvax-Next-Api } } - _audio.PlayPvs(backpack.Comp.ApproveSound, backpack.Owner); + _audio.PlayPvs(backpack.Comp.ApproveSound, entity); // Corvax-Next-Api QueueDel(backpack); } private void OnChangeSet(Entity backpack, ref ThiefBackpackChangeSetMessage args)