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<AccessReaderComponent>(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;
}
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}");
{
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");
- 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]
color: "#2eba22"
- state: door_remotescreencolour
color: "#22871a"
+ - type: DoorRemote
+ includeUserAccess: true
- type: Access
groups:
- AllAccess