Fingerprint taking improvements (#31864)
* now using event to check access to fingerprint * Opps actually commiting the changes --------- Co-authored-by: YourUsername <you@example.com> Co-authored-by: beck-thompson <beck314159@hotmail.com>
This commit is contained in:
24
Content.Server/Forensics/Systems/FingerprintMaskSystem.cs
Normal file
24
Content.Server/Forensics/Systems/FingerprintMaskSystem.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Content.Shared.Forensics;
|
||||
using Content.Shared.Forensics.Components;
|
||||
using Content.Shared.Inventory;
|
||||
|
||||
namespace Content.Server.Forensics;
|
||||
|
||||
public sealed class FingerprintMaskSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<FingerprintMaskComponent, InventoryRelayedEvent<TryAccessFingerprintEvent>>(OnTryAccessFingerprint);
|
||||
}
|
||||
|
||||
private void OnTryAccessFingerprint(EntityUid uid, FingerprintMaskComponent comp, ref InventoryRelayedEvent<TryAccessFingerprintEvent> args)
|
||||
{
|
||||
if (args.Args.Cancelled)
|
||||
return;
|
||||
|
||||
args.Args.Blocker = uid;
|
||||
args.Args.Cancel();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user