Stop ghosts from being logged to Airlocks (#36261)

* 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
This commit is contained in:
Luna "YuNii" Henrich
2025-04-04 00:24:30 +02:00
committed by GitHub
parent f2391cbcc9
commit db62336618
3 changed files with 16 additions and 8 deletions

View 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))
{
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<AccessReaderComponent>? ent)