From: Liza Carvelli Date: Wed, 27 Nov 2024 20:26:54 +0000 (+0100) Subject: Minor tweak to flying pathfindng starting location X-Git-Tag: v4.6~23 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=f3e418f440c116bbdf35003020c58878358f47df;p=Questionable.git Minor tweak to flying pathfindng starting location --- diff --git a/Questionable/Controller/MovementController.cs b/Questionable/Controller/MovementController.cs index e41b8f04..cc8012cf 100644 --- a/Questionable/Controller/MovementController.cs +++ b/Questionable/Controller/MovementController.cs @@ -317,6 +317,13 @@ internal sealed class MovementController : IDisposable _logger.LogInformation("Using modified start position for flying pathfinding: {StartPosition}", startPosition.ToString("G", CultureInfo.InvariantCulture)); } + else if (fly) + { + // other positions have a (lesser) chance of starting from underground too, in which case pathfinding takes + // >10 seconds and gets stuck trying to go through the ground. + // only for flying; as walking uses a different algorithm + startPosition = startPosition with { Y = startPosition.Y + 0.2f }; + } _pathfindTask = _navmeshIpc.Pathfind(startPosition, to, fly, _cancellationTokenSource.Token);