Increase NPC chase persistence (#12850)

This commit is contained in:
metalgearsloth
2022-12-07 10:34:23 +11:00
committed by GitHub
parent dd384c55a0
commit 540a3d9028
3 changed files with 17 additions and 8 deletions

View File

@@ -232,7 +232,7 @@ public sealed partial class PathfindingSystem
private bool IsBodyRelevant(PhysicsComponent body)
{
if (!body.Hard || !body.CanCollide || body.BodyType != BodyType.Static)
if (!body.Hard || body.BodyType != BodyType.Static)
{
return false;
}
@@ -262,7 +262,8 @@ public sealed partial class PathfindingSystem
private void OnBodyTypeChange(ref PhysicsBodyTypeChangedEvent ev)
{
if (IsBodyRelevant(ev.Component) &&
if (ev.Component.CanCollide &&
IsBodyRelevant(ev.Component) &&
TryComp<TransformComponent>(ev.Entity, out var xform) &&
xform.GridUid != null)
{