Skip to content

Commit

Permalink
Revert "Mirror: Restrict Door Remotes to only Being Able to Manipulat…
Browse files Browse the repository at this point in the history
…e Doors Relevant to Their Type" (#491)

Reverts #315

As [I brought
up](#315 (comment))
in the original pr, this change was made to counter power gaming, which
isn't as much of an issue on EE downstreams, and adversely affects the
engineering department, without any major benefits.

---------

Signed-off-by: stellar-novas <[email protected]>
Co-authored-by: DEATHB4DEFEAT <[email protected]>
  • Loading branch information
stellar-novas and DEATHB4DEFEAT authored Aug 1, 2024
1 parent 5f2cae0 commit 00a74a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Content.Server/Remotes/DoorRemoteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ private void OnBeforeInteract(Entity<DoorRemoteComponent> 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<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);
Popup.PopupEntity(Loc.GetString("door-remote-denied"), args.User, args.User);
Expand All @@ -61,15 +63,18 @@ private void OnBeforeInteract(Entity<DoorRemoteComponent> 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 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;
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

0 comments on commit 00a74a2

Please sign in to comment.