aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-01-20 19:46:01 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-20 23:16:21 +0100
commit0ed58b09526c5c0b8670348f4b72491852c2f1eb (patch)
tree55ab48dc05950d9c3a5fa1d1ec938ab7430594ab /src
parent1a070fd1271702689314ed13351de3675e834cde (diff)
Core/MMaps: Handle path on same position
Handle path on the same polygon between 2 very close positions as a normal path. (cherry picked from commit d293dd37822d93f9023d3ff9d39052ed976e236b)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Movement/PathGenerator.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp
index ac46a8963c8..1fb640cf3c5 100644
--- a/src/server/game/Movement/PathGenerator.cpp
+++ b/src/server/game/Movement/PathGenerator.cpp
@@ -529,7 +529,14 @@ void PathGenerator::BuildPointPath(const float *startPoint, const float *endPoin
_pointPathLimit); // maximum number of points
}
- if (pointCount < 2 || 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
+ dtVcopy(&pathPoints[1 * VERTEX_SIZE], endPoint);
+ pointCount++;
+ }
+ else if ( pointCount < 2 || dtStatusFailed(dtResult))
{
// only happens if pass bad data to findStraightPath or navmesh is broken
// single point paths can be generated here