Skip to content

Commit 93e3aed

Browse files
Restrict door remotes to only being able to manipulate doors relevant to their type (#26371)
Restrict door remotes to only being able to manipulate doors relevant to their type.
1 parent 141e4e4 commit 93e3aed

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Content.Server/Remotes/DoorRemoteSystem.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ private void OnBeforeInteract(Entity<DoorRemoteComponent> entity, ref BeforeRang
4747
return;
4848
}
4949

50-
// Holding the door remote grants you access to the relevant doors IN ADDITION to what ever access you had.
51-
// This access is enforced in _doorSystem.HasAccess when it calls _accessReaderSystem.IsAllowed
5250
if (TryComp<AccessReaderComponent>(args.Target, out var accessComponent)
53-
&& !_doorSystem.HasAccess(args.Target.Value, args.User, doorComp, accessComponent))
51+
&& !_doorSystem.HasAccess(args.Target.Value, args.Used, doorComp, accessComponent))
5452
{
5553
_doorSystem.Deny(args.Target.Value, doorComp, args.User);
5654
Popup.PopupEntity(Loc.GetString("door-remote-denied"), args.User, args.User);
@@ -60,18 +58,15 @@ private void OnBeforeInteract(Entity<DoorRemoteComponent> entity, ref BeforeRang
6058
switch (entity.Comp.Mode)
6159
{
6260
case OperatingMode.OpenClose:
63-
// Note we provide args.User here to TryToggleDoor as the "user"
64-
// This means that the door will look at all access items carryed by the player for access, including
65-
// this remote, but also including anything else they are carrying such as a PDA or ID card.
66-
if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, args.User))
61+
if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, args.Used))
6762
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User):player} used {ToPrettyString(args.Used)} on {ToPrettyString(args.Target.Value)}: {doorComp.State}");
6863
break;
6964
case OperatingMode.ToggleBolts:
7065
if (TryComp<DoorBoltComponent>(args.Target, out var boltsComp))
7166
{
7267
if (!boltsComp.BoltWireCut)
7368
{
74-
_doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, args.User);
69+
_doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, args.Used);
7570
_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");
7671
}
7772
}

0 commit comments

Comments
 (0)