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:
parent
d13cb4f583
commit
277689c9a6
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue