]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Stop ghosts from being logged to Airlocks (#36261)
authorLuna "YuNii" Henrich <yuniivrc+github@proton.me>
Thu, 3 Apr 2025 22:24:30 +0000 (00:24 +0200)
committerGitHub <noreply@github.com>
Thu, 3 Apr 2025 22:24:30 +0000 (00:24 +0200)
* stop ghosts from being logged

* thanks rider for the random import

* add new tag PreventAccessLogging

* once again removing random auto imports

* inverted if for code readability

* switch to ProtoId<> usage

Content.Shared/Access/Systems/AccessReaderSystem.cs
Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Resources/Prototypes/tags.yml

index 84de549b663667293037e3310f58b66ae15e0c2a..74cf74274dfdc058cf1705797299821696c993bd 100644 (file)
@@ -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<TagPrototype> 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))
-        {
+        if (!IsAllowed(access, stationKeys, target, reader))
+            return false;
+
+        if (!_tag.HasTag(user, PreventAccessLoggingTag))
             LogAccess((target, reader), user);
-            return true;
-        }
 
-        return false;
+        return true;
     }
 
     public bool GetMainAccessReader(EntityUid uid, [NotNullWhen(true)] out Entity<AccessReaderComponent>? ent)
index 8fecb53818616e4aedcaf144ea833461281b055e..e4ce500487e593d061f6ac01e73db2ae8f69e07f 100644 (file)
@@ -14,6 +14,7 @@
     - BypassDropChecks
     - NoConsoleSound
     - SilentStorageUser
+    - PreventAccessLogging
   - type: Input
     context: "aghost"
   - type: Ghost
index 952ab4f909593920941b3de4b08fff6f1bb4108c..8b2ae35873e61a171a6e7f71fc1fc4a6a699670f 100644 (file)
 - type: Tag
   id: Powerdrill
 
+- type: Tag
+  id: PreventAccessLogging
+
 - type: Tag
   id: PrisonUniform
 
 
 - 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