Fix admin ghosts not being able to see items in pockets or interact with them (#31076)

* Fix admin ghosts not being able to see items in pouches or interact with them

* fix

* oops

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
DrSmugleaf
2024-11-21 18:56:05 -08:00
committed by GitHub
parent 4f703ae9ce
commit 5a751a820a
6 changed files with 32 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Inventory;
using Content.Shared.Inventory.VirtualItem;
@@ -294,7 +295,7 @@ public abstract class SharedStrippableSystem : EntitySystem
if (!stealth)
{
if (slotDef.StripHidden)
if (IsStripHidden(slotDef, user))
_popupSystem.PopupEntity(Loc.GetString("strippable-component-alert-owner-hidden", ("slot", slot)), target, target, PopupType.Large);
else
_popupSystem.PopupEntity(Loc.GetString("strippable-component-alert-owner", ("user", Identity.Entity(user, EntityManager)), ("item", item)), target, target, PopupType.Large);
@@ -660,4 +661,15 @@ public abstract class SharedStrippableSystem : EntitySystem
if (args.CanDrop)
args.Handled = true;
}
public bool IsStripHidden(SlotDefinition definition, EntityUid? viewer)
{
if (!definition.StripHidden)
return false;
if (viewer == null)
return true;
return !HasComp<BypassInteractionChecksComponent>(viewer);
}
}