From 9fecdcdde3d28247b737817333efcedd77224f93 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 14 Feb 2022 15:44:21 +1300 Subject: [PATCH] Fix windoor deconstruction (#6581) --- Content.Server/Doors/Systems/DoorSystem.cs | 22 ++++++++----------- .../Doors/Windoors/base_structurewindoors.yml | 1 + .../Graphs/structures/airlock.yml | 19 +--------------- .../Graphs/structures/windoor.yml | 2 -- 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index b58f99d71f..2f56cd2655 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -5,7 +5,6 @@ using Content.Server.Construction; using Content.Server.Construction.Components; using Content.Server.Tools; using Content.Server.Tools.Components; -using Content.Server.Doors.Components; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; using Content.Shared.Doors; @@ -15,8 +14,6 @@ using Content.Shared.Interaction; using Content.Shared.Tag; using Robust.Shared.Audio; using Robust.Shared.Containers; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; using System.Linq; @@ -154,7 +151,9 @@ public sealed class DoorSystem : SharedDoorSystem RaiseLocalEvent(target, canEv, false); if (canEv.Cancelled) - return false; + // 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; var modEv = new DoorGetPryTimeModifierEvent(); RaiseLocalEvent(target, modEv, false); @@ -293,19 +292,16 @@ public sealed class DoorSystem : SharedDoorSystem var container = uid.EnsureContainer("board", out var existed); - /* // TODO ShadowCommander: Re-enable when access is added to boards. Requires map update. - if (existed) - { - // We already contain a board. Note: We don't check if it's the right one! - if (container.ContainedEntities.Count != 0) - return; + if (existed & container.ContainedEntities.Count != 0) + { + // We already contain a board. Note: We don't check if it's the right one! + return; } - var board = Owner.EntityManager.SpawnEntity(_boardPrototype, Owner.Transform.Coordinates); + var board = EntityManager.SpawnEntity(door.BoardPrototype, Transform(uid).Coordinates); if(!container.Insert(board)) - Logger.Warning($"Couldn't insert board {board} into door {Owner}!"); - */ + Logger.Warning($"Couldn't insert board {ToPrettyString(board)} into door {ToPrettyString(uid)}!"); } } diff --git a/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml b/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml index 33fe9bf654..9cad63e93a 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml @@ -76,6 +76,7 @@ - type: Door canCrush: false weldable: false + board: DoorElectronics openSound: path: /Audio/Machines/windoor_open.ogg closeSound: diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index 67b06f7ff9..40f46aab13 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -76,32 +76,15 @@ - node: airlock entity: Airlock edges: - - to: wired + - to: wired #TODO DOOR ELECTRONICS. If door electronics ever govern access permissions, this step should probably be further down? It makes it too easy to swap permissions around. See also windoor. conditions: - !type:EntityAnchored {} - !type:DoorWelded {} - !type:AirlockBolted value: false - !type:WirePanel {} - - !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated - container: board completed: - !type:EmptyAllContainers {} steps: - tool: Prying doAfter: 5 - - to: wired # TODO ShadowCommander: Remove when board spawning is implemented in ServerDoorComponent.cs. Needs a map update. - conditions: - - !type:EntityAnchored {} - - !type:DoorWelded {} - - !type:AirlockBolted - value: false - - !type:WirePanel {} - - !type:ContainerEmpty - container: board - completed: - - !type:SpawnPrototype - prototype: DoorElectronics - steps: - - tool: Prying - doAfter: 5 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml index 957616c133..84cd57deb8 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml @@ -112,8 +112,6 @@ - !type:AirlockBolted value: false - !type:WirePanel {} - - !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated - container: board completed: - !type:EmptyAllContainers {} steps: