From: BramvanZijp <56019239+BramvanZijp@users.noreply.github.com> Date: Sun, 29 Jun 2025 16:21:14 +0000 (+0200) Subject: Allow the Command & Super door remotes to use the access of their user. (Re-creation... X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7951db15ca0977302fe34d21533b728a222dadf8;p=space-station-14.git Allow the Command & Super door remotes to use the access of their user. (Re-creation of PR due to changes to game balance) (#35536) --- diff --git a/Content.Server/Remotes/DoorRemoteSystem.cs b/Content.Server/Remotes/DoorRemoteSystem.cs index 27df5ef34d..c3425f347a 100644 --- a/Content.Server/Remotes/DoorRemoteSystem.cs +++ b/Content.Server/Remotes/DoorRemoteSystem.cs @@ -51,11 +51,19 @@ namespace Content.Shared.Remotes return; } + var accessTarget = args.Used; + // This covers the accesses the REMOTE has, and is not effected by the user's ID card. + if (entity.Comp.IncludeUserAccess) // Allows some door remotes to inherit the user's access. + { + accessTarget = args.User; + // This covers the accesses the USER has, which always includes the remote's access since holding a remote acts like holding an ID card. + } + if (TryComp(args.Target, out var accessComponent) - && !_doorSystem.HasAccess(args.Target.Value, args.Used, doorComp, accessComponent)) + && !_doorSystem.HasAccess(args.Target.Value, accessTarget, doorComp, accessComponent)) { if (isAirlock) - _doorSystem.Deny(args.Target.Value, doorComp, args.User); + _doorSystem.Deny(args.Target.Value, doorComp, accessTarget); Popup.PopupEntity(Loc.GetString("door-remote-denied"), args.User, args.User); return; } @@ -63,7 +71,7 @@ namespace Content.Shared.Remotes switch (entity.Comp.Mode) { case OperatingMode.OpenClose: - if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, args.Used)) + if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, accessTarget)) _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User):player} used {ToPrettyString(args.Used)} on {ToPrettyString(args.Target.Value)}: {doorComp.State}"); @@ -73,7 +81,7 @@ namespace Content.Shared.Remotes { if (!boltsComp.BoltWireCut) { - _doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, args.Used); + _doorSystem.SetBoltsDown((args.Target.Value, boltsComp), !boltsComp.BoltsDown, accessTarget); _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"); diff --git a/Content.Shared/Remotes/Components/DoorRemoteComponent.cs b/Content.Shared/Remotes/Components/DoorRemoteComponent.cs index b157596e3b..64977596c2 100644 --- a/Content.Shared/Remotes/Components/DoorRemoteComponent.cs +++ b/Content.Shared/Remotes/Components/DoorRemoteComponent.cs @@ -8,6 +8,13 @@ public sealed partial class DoorRemoteComponent : Component [AutoNetworkedField] [DataField] public OperatingMode Mode = OperatingMode.OpenClose; + + /// + /// Does the remote allow the user to manipulate doors that they have access to, even if the remote itself does not? + /// + [AutoNetworkedField] + [DataField] + public bool IncludeUserAccess = false; } public enum OperatingMode : byte diff --git a/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml b/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml index 2a15014ce2..6b1efddad1 100644 --- a/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml +++ b/Resources/Prototypes/Catalog/Fills/Lockers/heads.yml @@ -43,7 +43,7 @@ - id: ClothingHeadsetAltCommand - id: ClothingOuterArmorCaptainCarapace - id: CommsComputerCircuitboard - - id: DoorRemoteCommand + - id: DoorRemoteCustom - id: MedalCase - id: NukeDisk - id: PinpointerNuclear diff --git a/Resources/Prototypes/Entities/Objects/Devices/door_remote.yml b/Resources/Prototypes/Entities/Objects/Devices/door_remote.yml index 45689958cf..8f7f6957b2 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/door_remote.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/door_remote.yml @@ -29,6 +29,24 @@ - type: Access groups: - Command + - type: DoorRemote + +- type: entity + parent: [DoorRemoteDefault, BaseCommandContraband] + id: DoorRemoteCustom + name: custom door remote + description: A gadget which can open and bolt doors remotely. This advanced variant does not have built-in access, instead inheriting the ID access of the user. + components: + - type: Sprite + layers: + - state: door_remotebase + - state: door_remotelightscolour + color: "#0077FF" + - state: door_remotescreencolour + color: "#0033EE" + - type: Access + - type: DoorRemote + includeUserAccess: true - type: entity parent: [DoorRemoteDefault, BaseCommandContraband] @@ -155,6 +173,8 @@ color: "#2eba22" - state: door_remotescreencolour color: "#22871a" + - type: DoorRemote + includeUserAccess: true - type: Access groups: - AllAccess