From 277689c9a649e2d12a41dd7efee7587393b86a94 Mon Sep 17 00:00:00 2001 From: Slava0135 <40753025+Slava0135@users.noreply.github.com> Date: Fri, 5 May 2023 18:14:32 +0300 Subject: [PATCH] make shields be able to block doorways (#16079) * you can block doors (doors now consider static fixtures) * this was unnecessary --- Content.Shared/Blocking/BlockingSystem.cs | 7 ++----- Content.Shared/Doors/Systems/SharedDoorSystem.cs | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Content.Shared/Blocking/BlockingSystem.cs b/Content.Shared/Blocking/BlockingSystem.cs index 8b1f9b38b7..d74e934680 100644 --- a/Content.Shared/Blocking/BlockingSystem.cs +++ b/Content.Shared/Blocking/BlockingSystem.cs @@ -152,18 +152,15 @@ public sealed partial class BlockingSystem : EntitySystem return false; } - //Don't allow someone to block if someone else is on the same tile or if they're inside of a doorway + //Don't allow someone to block if someone else is on the same tile var playerTileRef = xform.Coordinates.GetTileRef(); if (playerTileRef != null) { var intersecting = _lookup.GetEntitiesIntersecting(playerTileRef.Value); var mobQuery = GetEntityQuery(); - var doorQuery = GetEntityQuery(); - var xformQuery = GetEntityQuery(); - foreach (var uid in intersecting) { - if (uid != user && mobQuery.HasComponent(uid) || xformQuery.GetComponent(uid).Anchored && doorQuery.HasComponent(uid)) + if (uid != user && mobQuery.HasComponent(uid)) { TooCloseError(user); return false; diff --git a/Content.Shared/Doors/Systems/SharedDoorSystem.cs b/Content.Shared/Doors/Systems/SharedDoorSystem.cs index c105f69120..cf52ee5e3e 100644 --- a/Content.Shared/Doors/Systems/SharedDoorSystem.cs +++ b/Content.Shared/Doors/Systems/SharedDoorSystem.cs @@ -442,8 +442,7 @@ public abstract class SharedDoorSystem : EntitySystem if (!otherPhysics.CanCollide) continue; - if (otherPhysics.BodyType == BodyType.Static || (physics.CollisionMask & otherPhysics.CollisionLayer) == 0 - && (otherPhysics.CollisionMask & physics.CollisionLayer) == 0) + if ((physics.CollisionMask & otherPhysics.CollisionLayer) == 0 && (otherPhysics.CollisionMask & physics.CollisionLayer) == 0) continue; if (_entityLookup.GetWorldAABB(otherPhysics.Owner).IntersectPercentage(doorAABB) < IntersectPercentage) -- 2.51.2