make shields be able to block doorways (#16079)

* you can block doors
(doors now consider static fixtures)

* this was unnecessary
This commit is contained in:
Slava0135 2023-05-05 18:14:32 +03:00 committed by GitHub
parent d13cb4f583
commit 277689c9a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -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<MobStateComponent>();
var doorQuery = GetEntityQuery<DoorComponent>();
var xformQuery = GetEntityQuery<TransformComponent>();
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;

View File

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