Converted everything to use collision and physics component interfaces.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.GameObjects.Components.Access;
|
||||
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Pathfinders;
|
||||
@@ -148,7 +148,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
var targetNode = _pathfindingSystem.GetNode(targetTile);
|
||||
|
||||
var collisionMask = 0;
|
||||
if (entity.TryGetComponent(out CollidableComponent collidableComponent))
|
||||
if (entity.TryGetComponent(out ICollidableComponent collidableComponent))
|
||||
{
|
||||
collisionMask = collidableComponent.CollisionMask;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.GameObjects.Components.Access;
|
||||
using Content.Server.GameObjects.Components.Movement;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
@@ -27,7 +27,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
public static ReachableArgs GetArgs(IEntity entity)
|
||||
{
|
||||
var collisionMask = 0;
|
||||
if (entity.TryGetComponent(out CollidableComponent collidableComponent))
|
||||
if (entity.TryGetComponent(out ICollidableComponent collidableComponent))
|
||||
{
|
||||
collisionMask = collidableComponent.CollisionMask;
|
||||
}
|
||||
@@ -38,4 +38,4 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible
|
||||
return new ReachableArgs(visionRadius, access, collisionMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.Access;
|
||||
@@ -266,10 +266,10 @@ namespace Content.Server.GameObjects.EntitySystems.Pathfinding
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out CollidableComponent collidableComponent) &&
|
||||
if (entity.TryGetComponent(out ICollidableComponent collidableComponent) &&
|
||||
(PathfindingSystem.TrackedCollisionLayers & collidableComponent.CollisionLayer) != 0)
|
||||
{
|
||||
if (entity.TryGetComponent(out PhysicsComponent physicsComponent) && !physicsComponent.Anchored)
|
||||
if (entity.TryGetComponent(out IPhysicsComponent physicsComponent) && !physicsComponent.Anchored)
|
||||
{
|
||||
_physicsLayers.Add(entity.Uid, collidableComponent.CollisionLayer);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Content.Server.GameObjects.Components.Access;
|
||||
@@ -358,7 +358,7 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding
|
||||
|
||||
public bool CanTraverse(IEntity entity, PathfindingNode node)
|
||||
{
|
||||
if (entity.TryGetComponent(out CollidableComponent collidableComponent) &&
|
||||
if (entity.TryGetComponent(out ICollidableComponent collidableComponent) &&
|
||||
(collidableComponent.CollisionMask & node.BlockedCollisionMask) != 0)
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user