Move Access to ECS (#4826)
* Moved access to ecs * Fixed tests * Moved test to integration * Better IoC * Moved preset ID card * Moved id card to ECS * Moved access component to ECS * Fixed pda access * Final touches Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Content.Server.Access.Components;
|
||||
using Content.Server.Access.Systems;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Server.Projectiles.Components;
|
||||
using Content.Server.Singularity.Components;
|
||||
@@ -26,6 +27,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
public class EmitterSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -40,12 +42,12 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
{
|
||||
if(args.Handled) return;
|
||||
|
||||
if (component.AccessReader == null || !args.Used.TryGetComponent(out IAccess? access))
|
||||
if (component.AccessReader == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.AccessReader.IsAllowed(access))
|
||||
if (_accessReader.IsAllowed(component.AccessReader, args.Used.Uid))
|
||||
{
|
||||
component.IsLocked ^= true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user