From 38d1879f8b6ffa9026f719adf1a9f90cd4389ff4 Mon Sep 17 00:00:00 2001 From: stellar-novas Date: Fri, 28 Jun 2024 02:44:46 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"Mirror:=20Restrict=20door=20remot?= =?UTF-8?q?es=20to=20only=20being=20able=20to=20manipulate=20doors=20?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b1a67ccb7bd35aa4049c728921fdef281716c4c5. --- Content.Server/Remotes/DoorRemoteSystem.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Server/Remotes/DoorRemoteSystem.cs b/Content.Server/Remotes/DoorRemoteSystem.cs index e42bc700912..2d03f409b8f 100644 --- a/Content.Server/Remotes/DoorRemoteSystem.cs +++ b/Content.Server/Remotes/DoorRemoteSystem.cs @@ -50,8 +50,10 @@ private void OnBeforeInteract(Entity entity, ref BeforeRang 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.Used, doorComp, accessComponent)) + && !_doorSystem.HasAccess(args.Target.Value, args.User, doorComp, accessComponent)) { _doorSystem.Deny(args.Target.Value, doorComp, args.User); Popup.PopupEntity(Loc.GetString("door-remote-denied"), args.User, args.User); @@ -61,7 +63,10 @@ private void OnBeforeInteract(Entity entity, ref BeforeRang switch (entity.Comp.Mode) { case OperatingMode.OpenClose: - if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, args.Used)) + // 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)) _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: @@ -69,7 +74,7 @@ private void OnBeforeInteract(Entity entity, ref BeforeRang { if (!boltsComp.BoltWireCut) { - _doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, args.Used); + _doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, args.User); _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"); } } From b4ddff5028cb6db24ed518042b7a191d90a1ec8d Mon Sep 17 00:00:00 2001 From: stellar-novas Date: Sun, 28 Jul 2024 14:24:50 -0400 Subject: [PATCH 2/2] Typo moment not my fault i just pressed revert Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: stellar-novas --- Content.Server/Remotes/DoorRemoteSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/Remotes/DoorRemoteSystem.cs b/Content.Server/Remotes/DoorRemoteSystem.cs index 2d03f409b8f..31fcacdaf80 100644 --- a/Content.Server/Remotes/DoorRemoteSystem.cs +++ b/Content.Server/Remotes/DoorRemoteSystem.cs @@ -64,8 +64,8 @@ private void OnBeforeInteract(Entity entity, ref BeforeRang { 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. + // This means that the door will look at all access items carried 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)) _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User):player} used {ToPrettyString(args.Used)} on {ToPrettyString(args.Target.Value)}: {doorComp.State}"); break;