From 8c9803869291c40d8c07cbc4430847c6976cb201 Mon Sep 17 00:00:00 2001 From: 20kdc Date: Wed, 17 Nov 2021 01:00:58 +0000 Subject: [PATCH] fixrotations fixes rotations properly again (#5292) --- .../Commands/FixRotationsCommand.cs | 17 ++++++++- .../Entities/Structures/Windows/window.yml | 6 +++ Resources/Prototypes/tags.yml | 37 ++++++++++++------- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/Content.Server/Construction/Commands/FixRotationsCommand.cs b/Content.Server/Construction/Commands/FixRotationsCommand.cs index 224d337d4b..318c21edc9 100644 --- a/Content.Server/Construction/Commands/FixRotationsCommand.cs +++ b/Content.Server/Construction/Commands/FixRotationsCommand.cs @@ -1,7 +1,9 @@ using Content.Server.Administration; using Content.Server.Window; +using Content.Server.Power.Components; using Content.Shared.Administration; using Content.Shared.Construction; +using Content.Shared.Tag; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.GameObjects; @@ -74,9 +76,20 @@ namespace Content.Server.Construction.Commands var valid = false; - valid |= childEntity.HasComponent(); + // Occluders should only count if the state of it right now is enabled. + // This prevents issues with edge firelocks. + if (entityManager.TryGetComponent(childUid, out var occluder)) + { + valid |= occluder.Enabled; + } + // low walls & grilles valid |= childEntity.HasComponent(); - valid |= childEntity.HasComponent(); + // cables + valid |= childEntity.HasComponent(); + // anything else that might need this forced + valid |= childEntity.HasTag("ForceFixRotations"); + // override + valid &= !childEntity.HasTag("ForceNoFixRotations"); if (!valid) { diff --git a/Resources/Prototypes/Entities/Structures/Windows/window.yml b/Resources/Prototypes/Entities/Structures/Windows/window.yml index ae123d2d38..d76c470068 100644 --- a/Resources/Prototypes/Entities/Structures/Windows/window.yml +++ b/Resources/Prototypes/Entities/Structures/Windows/window.yml @@ -11,6 +11,7 @@ - type: Tag tags: - RCDDeconstructWhitelist + - ForceFixRotations - type: Sprite netsync: false drawdepth: WallTops @@ -76,6 +77,8 @@ snap: - Window components: + # Attention! If adding tags here: + # Keep WindowTintedDirectional in mind - type: Sprite netsync: false drawdepth: WallTops @@ -141,6 +144,9 @@ drawdepth: WallTops sprite: Structures/Windows/directional.rsi state: tinted_window + - type: Tag + tags: + - ForceNoFixRotations - type: Icon sprite: Structures/Windows/directional.rsi state: tinted_window diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index d7375805af..99e410ffa6 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -1,3 +1,5 @@ +# Alphabetical order is now apparently required. + - type: Tag id: Baguette @@ -88,6 +90,9 @@ - type: Tag id: Egg +- type: Tag + id: EmitterBolt + - type: Tag id: ExplosivePassable @@ -106,6 +111,12 @@ - type: Tag id: FootstepSound +- type: Tag + id: ForceFixRotations # fixrotations command WILL target this + +- type: Tag + id: ForceNoFixRotations # fixrotations command WON'T target this + - type: Tag id: Gauze @@ -114,6 +125,9 @@ - type: Tag id: Handcuffs + +- type: Tag + id: HideContextMenu - type: Tag id: Hoe @@ -142,6 +156,9 @@ - type: Tag id: NoSpinOnThrow +- type: Tag + id: NukeDisk + - type: Tag id: Ointment @@ -169,6 +186,9 @@ - type: Tag id: Powerdrill +- type: Tag + id: RCDDeconstructWhitelist + - type: Tag id: RodMetal1 @@ -205,23 +225,12 @@ - type: Tag id: Wirecutter +- type: Tag + id: Wooden # just like our atmos + - type: Tag id: Wrench - type: Tag id: Write -- type: Tag - id: RCDDeconstructWhitelist - -- type: Tag - id: Wooden # just like our atmos - -- type: Tag - id: EmitterBolt - -- type: Tag - id: HideContextMenu - -- type: Tag - id: NukeDisk