Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Mirror: Restrict Door Remotes to only Being Able to Manipulate Doors Relevant to Their Type" #491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Content.Server/Remotes/DoorRemoteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ 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<AccessReaderComponent>(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);
ShowPopupToUser("door-remote-denied", args.User);
Expand All @@ -92,15 +94,18 @@ private void OnBeforeInteract(EntityUid uid, DoorRemoteComponent component, Befo
switch (component.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:
if (TryComp<DoorBoltComponent>(args.Target, out var boltsComp))
{
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");
}
}
Expand Down
Loading