This commit is contained in:
Rane
2022-02-17 21:43:24 -05:00
committed by GitHub
parent 94c56980cb
commit 8049a709e6
29 changed files with 323 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Hands.Components;
using Content.Shared.Inventory;
using Content.Shared.Emag.Systems;
using Content.Shared.PDA;
using Content.Shared.Access.Components;
using Robust.Shared.GameObjects;
@@ -22,6 +23,7 @@ namespace Content.Shared.Access.Systems
{
base.Initialize();
SubscribeLocalEvent<AccessReaderComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<AccessReaderComponent, GotEmaggedEvent>(OnEmagged);
}
private void OnInit(EntityUid uid, AccessReaderComponent reader, ComponentInit args)
@@ -36,6 +38,15 @@ namespace Content.Shared.Access.Systems
}
}
private void OnEmagged(EntityUid uid, AccessReaderComponent reader, GotEmaggedEvent args)
{
if (reader.Enabled == true)
{
reader.Enabled = false;
args.Handled = true;
}
}
/// <summary>
/// Searches an <see cref="AccessComponent"/> in the entity itself, in its active hand or in its ID slot.
/// Then compares the found access with the configured access lists to see if it is allowed.