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)
{