Add pathfinding support for NPCs climbing tables (#17415)
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Destructible;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Climbing;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.Physics;
|
||||
@@ -154,11 +155,12 @@ public sealed partial class PathfindingSystem
|
||||
var accessQuery = GetEntityQuery<AccessReaderComponent>();
|
||||
var destructibleQuery = GetEntityQuery<DestructibleComponent>();
|
||||
var doorQuery = GetEntityQuery<DoorComponent>();
|
||||
var climbableQuery = GetEntityQuery<ClimbableComponent>();
|
||||
var fixturesQuery = GetEntityQuery<FixturesComponent>();
|
||||
var physicsQuery = GetEntityQuery<PhysicsComponent>();
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
BuildBreadcrumbs(dirt[i], mapGridComp, accessQuery, destructibleQuery, doorQuery, fixturesQuery,
|
||||
physicsQuery, xformQuery);
|
||||
BuildBreadcrumbs(dirt[i], mapGridComp, accessQuery, destructibleQuery, doorQuery, climbableQuery,
|
||||
fixturesQuery, physicsQuery, xformQuery);
|
||||
});
|
||||
|
||||
const int Division = 4;
|
||||
@@ -423,6 +425,7 @@ public sealed partial class PathfindingSystem
|
||||
EntityQuery<AccessReaderComponent> accessQuery,
|
||||
EntityQuery<DestructibleComponent> destructibleQuery,
|
||||
EntityQuery<DoorComponent> doorQuery,
|
||||
EntityQuery<ClimbableComponent> climbableQuery,
|
||||
EntityQuery<FixturesComponent> fixturesQuery,
|
||||
EntityQuery<PhysicsComponent> physicsQuery,
|
||||
EntityQuery<TransformComponent> xformQuery)
|
||||
@@ -540,6 +543,11 @@ public sealed partial class PathfindingSystem
|
||||
flags |= PathfindingBreadcrumbFlag.Door;
|
||||
}
|
||||
|
||||
if (climbableQuery.HasComponent(ent))
|
||||
{
|
||||
flags |= PathfindingBreadcrumbFlag.Climb;
|
||||
}
|
||||
|
||||
if (destructibleQuery.TryGetComponent(ent, out var damageable))
|
||||
{
|
||||
damage += _destructible.DestroyedAt(ent, damageable).Float();
|
||||
|
||||
Reference in New Issue
Block a user