aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-04-12 23:23:31 +0200
committerShauren <shauren.trinity@gmail.com>2021-11-27 01:38:11 +0100
commitbf1bf510fb79e2caf6a643a71e98974d61e33064 (patch)
tree64abf3e1f6b9c333ebbd4e1f72c4d7ff56bd4b48 /src
parent15aece546f56ea2210b98bb46f6be542a174bd89 (diff)
Core/MMaps: Fallback to shortcut for flying units if Detour returned an incomplete path.
Fallback to shortcut for flying units if Detour returned an incomplete path. This is needed when a flying unit should fly to the floor below to reach the target, but since Recastnavigation doesn't support "jumping down" the unit would not find a path to the target. (cherry picked from commit d182e5f7e73e614185f4470429467befd6e03981)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Movement/PathGenerator.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp
index e8c64195910..54906a1f51f 100644
--- a/src/server/game/Movement/PathGenerator.cpp
+++ b/src/server/game/Movement/PathGenerator.cpp
@@ -469,6 +469,13 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
else
_type = PATHFIND_INCOMPLETE;
+ if (_type & PATHFIND_INCOMPLETE && _sourceUnit->CanFly())
+ {
+ BuildShortcut();
+ _type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH);
+ return;
+ }
+
// generate the point-path out of our up-to-date poly-path
BuildPointPath(startPoint, endPoint);
}