Pathfinder hotfixes (#8201)
This commit is contained in:
@@ -38,17 +38,6 @@ namespace Content.Server.AI.Pathfinding
|
||||
GenerateMask();
|
||||
}
|
||||
|
||||
public static bool IsRelevant(EntityUid entity, IPhysBody physicsComponent)
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).GridID == GridId.Invalid ||
|
||||
(PathfindingSystem.TrackedCollisionLayers & physicsComponent.CollisionLayer) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return our neighboring nodes (even across chunks)
|
||||
/// </summary>
|
||||
@@ -93,7 +82,7 @@ namespace Content.Server.AI.Pathfinding
|
||||
}
|
||||
}
|
||||
|
||||
public PathfindingNode? GetNeighbor(Direction direction)
|
||||
public PathfindingNode? GetNeighbor(Direction direction, IEntityManager? entManager = null)
|
||||
{
|
||||
var chunkXOffset = TileRef.X - ParentChunk.Indices.X;
|
||||
var chunkYOffset = TileRef.Y - ParentChunk.Indices.Y;
|
||||
@@ -254,9 +243,9 @@ namespace Content.Server.AI.Pathfinding
|
||||
/// <param name="entity"></param>
|
||||
/// TODO: These 2 methods currently don't account for a bunch of changes (e.g. airlock unpowered, wrenching, etc.)
|
||||
/// TODO: Could probably optimise this slightly more.
|
||||
public void AddEntity(EntityUid entity, IPhysBody physicsComponent)
|
||||
public void AddEntity(EntityUid entity, IPhysBody physicsComponent, IEntityManager? entMan = null)
|
||||
{
|
||||
var entMan = IoCManager.Resolve<IEntityManager>();
|
||||
IoCManager.Resolve(ref entMan);
|
||||
// If we're a door
|
||||
if (entMan.HasComponent<AirlockComponent>(entity) || entMan.HasComponent<DoorComponent>(entity))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user