Skip to content

Commit

Permalink
Implant fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed Nov 15, 2024
1 parent 938f4d0 commit 80ba7be
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Content.Server/Thief/Systems/ThiefUndeterminedBackpackSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -34,6 +35,13 @@ private void OnUIOpened(Entity<ThiefUndeterminedBackpackComponent> backpack, ref

private void OnApprove(Entity<ThiefUndeterminedBackpackComponent> backpack, ref ThiefBackpackApproveMessage args)
{
// Corvax-Next-Api-Start
var entity = backpack.Owner;

if (TryComp<SubdermalImplantComponent>(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;

Expand All @@ -42,12 +50,12 @@ private void OnApprove(Entity<ThiefUndeterminedBackpackComponent> 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<ItemComponent>(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<ThiefUndeterminedBackpackComponent> backpack, ref ThiefBackpackChangeSetMessage args)
Expand Down

0 comments on commit 80ba7be

Please sign in to comment.