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

CentComm Map Updates #34475

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
34 changes: 23 additions & 11 deletions Content.Server/Remotes/DoorRemoteSystem.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Content.Server.Administration.Logs;
using Content.Shared.Interaction;
using Content.Shared.Doors.Components;
using Content.Shared.Access.Components;
using Content.Server.Doors.Systems;
using Content.Server.Power.EntitySystems;
using Content.Shared.Access.Components;
using Content.Shared.Database;
using Content.Shared.Doors.Components;
using Content.Shared.Examine;
using Content.Shared.Remotes.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Remotes.Components;
using Content.Shared.Remotes.EntitySystems;

namespace Content.Shared.Remotes
{
Expand All @@ -17,6 +17,7 @@ public sealed class DoorRemoteSystem : SharedDoorRemoteSystem
[Dependency] private readonly AirlockSystem _airlock = default!;
[Dependency] private readonly DoorSystem _doorSystem = default!;
[Dependency] private readonly ExamineSystemShared _examine = default!;

public override void Initialize()
{
base.Initialize();
Expand All @@ -31,9 +32,12 @@ private void OnBeforeInteract(Entity<DoorRemoteComponent> entity, ref BeforeRang
if (args.Handled
|| args.Target == null
|| !TryComp<DoorComponent>(args.Target, out var doorComp) // If it isn't a door we don't use it
// Only able to control doors if they are within your vision and within your max range.
// Not affected by mobs or machines anymore.
|| !_examine.InRangeUnOccluded(args.User, args.Target.Value, SharedInteractionSystem.MaxRaycastRange, null))
// Only able to control doors if they are within your vision and within your max range.
// Not affected by mobs or machines anymore.
|| !_examine.InRangeUnOccluded(args.User,
args.Target.Value,
SharedInteractionSystem.MaxRaycastRange,
null))

{
return;
Expand All @@ -50,7 +54,8 @@ private void OnBeforeInteract(Entity<DoorRemoteComponent> entity, ref BeforeRang
if (TryComp<AccessReaderComponent>(args.Target, out var accessComponent)
&& !_doorSystem.HasAccess(args.Target.Value, args.Used, doorComp, accessComponent))
{
_doorSystem.Deny(args.Target.Value, doorComp, args.User);
if (isAirlock)
_doorSystem.Deny(args.Target.Value, doorComp, args.User);
Comment on lines +57 to +58
Copy link
Contributor

@IProduceWidgets IProduceWidgets Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will impact remotes working on all shutters, blastdoors, gates (and curtains lmao). Probably fine?

Also looks like it stops them from denying on firelocks though.

Copy link
Contributor Author

@minus1over12 minus1over12 Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Airlocks will still get denied unless you have the engineering remote or are opening an airlock without a lockout. Any shutters that do not have a door control board with access control (which is all of them except the 8 mapped on CentComm in this PR) can still be controlled by any of the door remotes. _doorSystem.Deny is just visuals and sounds according to the summary.

Popup.PopupEntity(Loc.GetString("door-remote-denied"), args.User, args.User);
return;
}
Expand All @@ -59,25 +64,32 @@ private void OnBeforeInteract(Entity<DoorRemoteComponent> entity, ref BeforeRang
{
case OperatingMode.OpenClose:
if (_doorSystem.TryToggleDoor(args.Target.Value, doorComp, args.Used))
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User):player} used {ToPrettyString(args.Used)} on {ToPrettyString(args.Target.Value)}: {doorComp.State}");
_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);
_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");
_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");
}
}

break;
case OperatingMode.ToggleEmergencyAccess:
if (airlockComp != null)
{
_airlock.SetEmergencyAccess((args.Target.Value, airlockComp), !airlockComp.EmergencyAccess);
_adminLogger.Add(LogType.Action, LogImpact.Medium,
_adminLogger.Add(LogType.Action,
LogImpact.Medium,
$"{ToPrettyString(args.User):player} used {ToPrettyString(args.Used)} on {ToPrettyString(args.Target.Value)} to set emergency access {(airlockComp.EmergencyAccess ? "on" : "off")}");
}

break;
default:
throw new InvalidOperationException(
Expand Down
Loading
Loading