From c47ec40c436f57840d1514006c744e4a26fc7fc1 Mon Sep 17 00:00:00 2001 From: Slava0135 <40753025+Slava0135@users.noreply.github.com> Date: Fri, 5 May 2023 16:16:23 +0300 Subject: [PATCH] prevent from prying blast doors (#16077) --- Content.Server/Doors/Systems/DoorSystem.cs | 2 +- Content.Shared/Doors/Components/DoorComponent.cs | 5 ++++- .../Entities/Structures/Doors/Shutter/blast_door.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index e35ef5c9da..7b34a3c08b 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -185,7 +185,7 @@ public sealed class DoorSystem : SharedDoorSystem var canEv = new BeforeDoorPryEvent(user, tool); RaiseLocalEvent(target, canEv, false); - if (canEv.Cancelled) + if (!door.CanPry || canEv.Cancelled) // mark handled, as airlock component will cancel after generating a pop-up & you don't want to pry a tile // under a windoor. return true; diff --git a/Content.Shared/Doors/Components/DoorComponent.cs b/Content.Shared/Doors/Components/DoorComponent.cs index 242d8f243d..2be28ab5c4 100644 --- a/Content.Shared/Doors/Components/DoorComponent.cs +++ b/Content.Shared/Doors/Components/DoorComponent.cs @@ -262,13 +262,16 @@ public sealed class DoorComponent : Component } #endregion + [DataField("canPry"), ViewVariables(VVAccess.ReadWrite)] + public bool CanPry = true; + [DataField("pryingQuality", customTypeSerializer: typeof(PrototypeIdSerializer))] public string PryingQuality = "Prying"; /// /// Default time that the door should take to pry open. /// - [DataField("pryTime")] + [DataField("pryTime"), ViewVariables(VVAccess.ReadWrite)] public float PryTime = 1.5f; [DataField("changeAirtight")] diff --git a/Resources/Prototypes/Entities/Structures/Doors/Shutter/blast_door.yml b/Resources/Prototypes/Entities/Structures/Doors/Shutter/blast_door.yml index b43222016f..02259ebcaa 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Shutter/blast_door.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Shutter/blast_door.yml @@ -17,7 +17,7 @@ openTimeTwo: 0.4 openingAnimationTime: 1.0 closingAnimationTime: 1.0 - pryTime: -1 + canPry: false crushDamage: types: Blunt: 25 # yowch