fixrotations fixes rotations properly again (#5292)

This commit is contained in:
20kdc
2021-11-17 01:00:58 +00:00
committed by GitHub
parent ef92a59132
commit 8c98038692
3 changed files with 44 additions and 16 deletions

View File

@@ -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<OccluderComponent>();
// Occluders should only count if the state of it right now is enabled.
// This prevents issues with edge firelocks.
if (entityManager.TryGetComponent<OccluderComponent>(childUid, out var occluder))
{
valid |= occluder.Enabled;
}
// low walls & grilles
valid |= childEntity.HasComponent<SharedCanBuildWindowOnTopComponent>();
valid |= childEntity.HasComponent<WindowComponent>();
// cables
valid |= childEntity.HasComponent<CableComponent>();
// anything else that might need this forced
valid |= childEntity.HasTag("ForceFixRotations");
// override
valid &= !childEntity.HasTag("ForceNoFixRotations");
if (!valid)
{

View File

@@ -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

View File

@@ -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