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:
committed by
GitHub
parent
f2391cbcc9
commit
db62336618
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user