diff --git a/Content.Shared/IdentityManagement/Identity.cs b/Content.Shared/IdentityManagement/Identity.cs index cdb3c81ada..836adfcdf8 100644 --- a/Content.Shared/IdentityManagement/Identity.cs +++ b/Content.Shared/IdentityManagement/Identity.cs @@ -49,11 +49,17 @@ public static class Identity /// This is an extension method because of its simplicity, and if it was any harder to call it might not /// be used enough for loc. /// - public static EntityUid Entity(EntityUid uid, IEntityManager ent) + /// + /// If this entity can see through identities, this method will always return the actual target entity. + /// + public static EntityUid Entity(EntityUid uid, IEntityManager ent, EntityUid? viewer = null) { if (!ent.TryGetComponent(uid, out var identity)) return uid; + if (viewer != null && CanSeeThroughIdentity(uid, viewer.Value, ent)) + return uid; + return identity.IdentityEntitySlot.ContainedEntity ?? uid; }