Fix pathfinding exception (#11228)

This commit is contained in:
Leon Friedrich
2022-09-14 19:06:24 +12:00
committed by GitHub
parent e060b2cf41
commit 6b05861068
2 changed files with 12 additions and 10 deletions

View File

@@ -77,6 +77,9 @@ public sealed class PickAccessibleComponentOperator : HTNOperator
// TODO: God the path api sucks PLUS I need some fast way to get this.
var job = _path.RequestPath(owner, target.Owner, CancellationToken.None);
if (job == null)
continue;
await job.AsTask;
if (job.Result == null || !_entManager.TryGetComponent<TransformComponent>(target.Owner, out var targetXform))