From 923a993f1e7ae38cd5f7ce195c52d903f352a2ff Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 6 Jan 2022 10:15:16 -0500 Subject: [PATCH] Core/MMaps: Handle path on same position Port From (https://github.com/TrinityCore/TrinityCore/commit/0ed58b09526c5c0b8670348f4b72491852c2f1eb) --- Source/Game/Movement/Generators/PathGenerator.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Game/Movement/Generators/PathGenerator.cs b/Source/Game/Movement/Generators/PathGenerator.cs index 09eed9f0b..caf0ff6e4 100644 --- a/Source/Game/Movement/Generators/PathGenerator.cs +++ b/Source/Game/Movement/Generators/PathGenerator.cs @@ -522,7 +522,14 @@ namespace Game.Movement _pointPathLimit); // maximum number of points } - if (pointCount < 2 || Detour.dtStatusFailed(dtResult)) + // Special case with start and end positions very close to each other + if (_polyLength == 1 && pointCount == 1) + { + // First point is start position, append end position + Detour.dtVcopy(pathPoints, 1 * 3, endPoint, 0); + pointCount++; + } + else if (pointCount < 2 || Detour.dtStatusFailed(dtResult)) { // only happens if pass bad data to findStraightPath or navmesh is broken // single point paths can be generated here