From 017efdaa155817c291f9fdf9f02b05f4f1a2f2a8 Mon Sep 17 00:00:00 2001 From: SimpleStation14 Date: Mon, 22 Apr 2024 05:51:57 -0400 Subject: [PATCH] Cherry-picked commit 93e3aed26e30375058aa44482236410ff31484f0 from space-wizards/space-station-14/master --- Content.Server/Remotes/DoorRemoteSystem.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Content.Server/Remotes/DoorRemoteSystem.cs b/Content.Server/Remotes/DoorRemoteSystem.cs index 9be7e5e96b4..6403c41addf 100644 --- a/Content.Server/Remotes/DoorRemoteSystem.cs +++ b/Content.Server/Remotes/DoorRemoteSystem.cs @@ -80,10 +80,8 @@ private void OnBeforeInteract(EntityUid uid, DoorRemoteComponent component, Befo return; } - // Holding the door remote grants you access to the relevant doors IN ADDITION to what ever access you had. - // This access is enforced in _doorSystem.HasAccess when it calls _accessReaderSystem.IsAllowed if (TryComp(args.Target, out var accessComponent) - && !_doorSystem.HasAccess(args.Target.Value, args.User, doorComp, accessComponent)) + && !_doorSystem.HasAccess(args.Target.Value, args.Used, doorComp, accessComponent)) { _doorSystem.Deny(args.Target.Value, doorComp, args.User); ShowPopupToUser("door-remote-denied", args.User); @@ -93,10 +91,7 @@ private void OnBeforeInteract(EntityUid uid, DoorRemoteComponent component, Befo switch (component.Mode) { case OperatingMode.OpenClose: - // Note we provide args.User here to TryToggleDoor as the "user" - // This means that the door will look at all access items carryed by the player for access, including - // this remote, but also including anything else they are carrying such as a PDA or ID card. - if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, args.User)) + if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, args.Used)) _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User):player} used {ToPrettyString(args.Used)} on {ToPrettyString(args.Target.Value)}: {doorComp.State}"); break; case OperatingMode.ToggleBolts: @@ -104,7 +99,7 @@ private void OnBeforeInteract(EntityUid uid, DoorRemoteComponent component, Befo { if (!boltsComp.BoltWireCut) { - _doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, args.User); + _doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, args.Used); _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User):player} used {ToPrettyString(args.Used)} on {ToPrettyString(args.Target.Value)} to {(boltsComp.BoltsDown ? "" : "un")}bolt it"); } }