diff --git a/Content.Shared/Access/Systems/AccessReaderSystem.cs b/Content.Shared/Access/Systems/AccessReaderSystem.cs index 84de549b66..74cf74274d 100644 --- a/Content.Shared/Access/Systems/AccessReaderSystem.cs +++ b/Content.Shared/Access/Systems/AccessReaderSystem.cs @@ -12,6 +12,7 @@ using Robust.Shared.Containers; using Robust.Shared.GameStates; using Content.Shared.GameTicking; using Content.Shared.IdentityManagement; +using Content.Shared.Tag; using Robust.Shared.Collections; using Robust.Shared.Prototypes; using Robust.Shared.Timing; @@ -24,11 +25,14 @@ public sealed class AccessReaderSystem : EntitySystem [Dependency] private readonly InventorySystem _inventorySystem = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly EmagSystem _emag = default!; + [Dependency] private readonly TagSystem _tag = default!; [Dependency] private readonly SharedGameTicker _gameTicker = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedStationRecordsSystem _recordsSystem = default!; + private static readonly ProtoId PreventAccessLoggingTag = "PreventAccessLogging"; + public override void Initialize() { base.Initialize(); @@ -115,13 +119,13 @@ public sealed class AccessReaderSystem : EntitySystem var access = FindAccessTags(user, accessSources); FindStationRecordKeys(user, out var stationKeys, accessSources); - if (IsAllowed(access, stationKeys, target, reader)) - { - LogAccess((target, reader), user); - return true; - } + if (!IsAllowed(access, stationKeys, target, reader)) + return false; - return false; + if (!_tag.HasTag(user, PreventAccessLoggingTag)) + LogAccess((target, reader), user); + + return true; } public bool GetMainAccessReader(EntityUid uid, [NotNullWhen(true)] out Entity? ent) diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index 8fecb53818..e4ce500487 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -14,6 +14,7 @@ - BypassDropChecks - NoConsoleSound - SilentStorageUser + - PreventAccessLogging - type: Input context: "aghost" - type: Ghost diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 952ab4f909..8b2ae35873 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -1026,6 +1026,9 @@ - type: Tag id: Powerdrill +- type: Tag + id: PreventAccessLogging + - type: Tag id: PrisonUniform @@ -1287,10 +1290,10 @@ - type: Tag id: Truncheon - + - type: Tag id: TurretCompatibleWeapon # Used in the construction of sentry turrets - + - type: Tag id: TurretControlElectronics # Used in the construction of sentry turret control panels