Fix adding/removing airlock protections via welding (#19926)
This commit is contained in:
@@ -9,6 +9,7 @@ using Content.Shared.Doors.Systems;
|
||||
using Content.Shared.Interaction;
|
||||
using Robust.Server.GameObjects;
|
||||
using Content.Shared.Wires;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Doors.Systems;
|
||||
|
||||
@@ -17,6 +18,7 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
||||
[Dependency] private readonly WiresSystem _wiresSystem = default!;
|
||||
[Dependency] private readonly PowerReceiverSystem _power = default!;
|
||||
[Dependency] private readonly DoorBoltSystem _bolts = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -149,8 +151,11 @@ public sealed class AirlockSystem : SharedAirlockSystem
|
||||
|
||||
private void OnActivate(EntityUid uid, AirlockComponent component, ActivateInWorldEvent args)
|
||||
{
|
||||
if (TryComp<WiresPanelComponent>(uid, out var panel) && panel.Open && panel.WiresAccessible
|
||||
&& TryComp<ActorComponent>(args.User, out var actor))
|
||||
if (TryComp<WiresPanelComponent>(uid, out var panel) &&
|
||||
panel.Open &&
|
||||
_prototypeManager.TryIndex<WiresPanelSecurityLevelPrototype>(panel.CurrentSecurityLevelID, out var securityLevelPrototype) &&
|
||||
securityLevelPrototype.WiresAccessible &&
|
||||
TryComp<ActorComponent>(args.User, out var actor))
|
||||
{
|
||||
_wiresSystem.OpenUserInterface(uid, actor.PlayerSession);
|
||||
args.Handled = true;
|
||||
|
||||
Reference in New Issue
Block a user