diff options
author | jackpoz <giacomopoz@gmail.com> | 2019-04-12 23:56:29 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2019-04-12 23:56:29 +0200 |
commit | 386b5a6fd948b4866cbd9a8a9892e8777922e9c9 (patch) | |
tree | a699f4dd626f1899e2f3c811971c78f207f7fa96 /src | |
parent | d182e5f7e73e614185f4470429467befd6e03981 (diff) |
Core/MMaps: Simplify d182e5f7e73e614185f4470429467befd6e03981 and handle PATHFIND_INCOMPLETE in ChaseMovementGenerator as "cannot reach the target"
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Movement/PathGenerator.cpp | 7 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp index 2df86222c33..7b765762fa9 100644 --- a/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.cpp @@ -184,8 +184,8 @@ bool ChaseMovementGenerator::Update(Unit* owner, uint32 diff) if (owner->IsHovering()) owner->UpdateAllowedPositionZ(x, y, z); - bool success = _path->CalculatePath(x, y, z); - if (!success || (_path->GetPathType() & PATHFIND_NOPATH)) + bool success = _path->CalculatePath(x, y, z, cOwner->CanFly()); + if (!success || (_path->GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE))) { if (cOwner) cOwner->SetCannotReachTarget(true); diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 19b6528a250..69844b2c15b 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -469,13 +469,6 @@ 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); } |