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 Robust.Shared.GameStates;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
|
using Content.Shared.Tag;
|
||||||
using Robust.Shared.Collections;
|
using Robust.Shared.Collections;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
@@ -24,11 +25,14 @@ public sealed class AccessReaderSystem : EntitySystem
|
|||||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
[Dependency] private readonly EmagSystem _emag = default!;
|
[Dependency] private readonly EmagSystem _emag = default!;
|
||||||
|
[Dependency] private readonly TagSystem _tag = default!;
|
||||||
[Dependency] private readonly SharedGameTicker _gameTicker = default!;
|
[Dependency] private readonly SharedGameTicker _gameTicker = default!;
|
||||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||||
[Dependency] private readonly SharedStationRecordsSystem _recordsSystem = default!;
|
[Dependency] private readonly SharedStationRecordsSystem _recordsSystem = default!;
|
||||||
|
|
||||||
|
private static readonly ProtoId<TagPrototype> PreventAccessLoggingTag = "PreventAccessLogging";
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -115,13 +119,13 @@ public sealed class AccessReaderSystem : EntitySystem
|
|||||||
var access = FindAccessTags(user, accessSources);
|
var access = FindAccessTags(user, accessSources);
|
||||||
FindStationRecordKeys(user, out var stationKeys, accessSources);
|
FindStationRecordKeys(user, out var stationKeys, accessSources);
|
||||||
|
|
||||||
if (IsAllowed(access, stationKeys, target, reader))
|
if (!IsAllowed(access, stationKeys, target, reader))
|
||||||
{
|
return false;
|
||||||
LogAccess((target, reader), user);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
if (!_tag.HasTag(user, PreventAccessLoggingTag))
|
||||||
|
LogAccess((target, reader), user);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetMainAccessReader(EntityUid uid, [NotNullWhen(true)] out Entity<AccessReaderComponent>? ent)
|
public bool GetMainAccessReader(EntityUid uid, [NotNullWhen(true)] out Entity<AccessReaderComponent>? ent)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
- BypassDropChecks
|
- BypassDropChecks
|
||||||
- NoConsoleSound
|
- NoConsoleSound
|
||||||
- SilentStorageUser
|
- SilentStorageUser
|
||||||
|
- PreventAccessLogging
|
||||||
- type: Input
|
- type: Input
|
||||||
context: "aghost"
|
context: "aghost"
|
||||||
- type: Ghost
|
- type: Ghost
|
||||||
|
|||||||
@@ -1026,6 +1026,9 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
id: Powerdrill
|
id: Powerdrill
|
||||||
|
|
||||||
|
- type: Tag
|
||||||
|
id: PreventAccessLogging
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: PrisonUniform
|
id: PrisonUniform
|
||||||
|
|
||||||
@@ -1287,10 +1290,10 @@
|
|||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: Truncheon
|
id: Truncheon
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: TurretCompatibleWeapon # Used in the construction of sentry turrets
|
id: TurretCompatibleWeapon # Used in the construction of sentry turrets
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: TurretControlElectronics # Used in the construction of sentry turret control panels
|
id: TurretControlElectronics # Used in the construction of sentry turret control panels
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user