Skip to content

Commit

Permalink
Fix agent ID card unlimited range (space-wizards#32445)
Browse files Browse the repository at this point in the history
* Fix agent ID card unlimited range

* update order to be more optimized
  • Loading branch information
themias authored Sep 25, 2024
1 parent 7168959 commit e0a3d3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Content.Server/Access/Systems/AgentIDCardSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override void Initialize()

private void OnAfterInteract(EntityUid uid, AgentIDCardComponent component, AfterInteractEvent args)
{
if (!TryComp<AccessComponent>(args.Target, out var targetAccess) || !HasComp<IdCardComponent>(args.Target) || args.Target == null)
if (args.Target == null || !args.CanReach || !TryComp<AccessComponent>(args.Target, out var targetAccess) || !HasComp<IdCardComponent>(args.Target))
return;

if (!TryComp<AccessComponent>(uid, out var access) || !HasComp<IdCardComponent>(uid))
Expand Down

0 comments on commit e0a3d3d

Please sign in to comment.