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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user