diff options
author | jackpoz <giacomopoz@gmail.com> | 2019-08-18 11:08:06 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-18 20:57:57 +0100 |
commit | bea0e48531bae904079ea5b9f489a436e58abaed (patch) | |
tree | 2a110b30ebbe567b1e2216022d46f476315d2661 | |
parent | 8f3904f8fd4e7536d1e7ba8e701f4774519fd867 (diff) |
Core/MMaps: Fix mobs evading when target is out of MMap meshes
Fix mobs evading when target is out of MMap meshes causes by an overzealous check added in c602220e02bed1ad76c9e60064eeec5fd97bfe80 when trying to fix an infinite loop in Recast.
If the target is outside of the MMap mesh (for example very close to a wall which is an un-walkable area with current TrinityCore settings and that might be changed in the future) Detour will not be able to find the height of the poly and getPolyHeight() will return DT_FAILURE | DT_INVALID_PARAM . Most of the time this is ok and can be ignored and it's still better than having the Unit evade.
Fix #23613
(cherry picked from commit 5a980226497605b18f1855fa39f340c10ee9dd53)
-rw-r--r-- | src/server/game/Movement/PathGenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index e8c64195910..bb39fc34afc 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -823,7 +823,7 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo npolys = FixupCorridor(polys, npolys, MAX_PATH_LENGTH, visited, nvisited); if (dtStatusFailed(_navMeshQuery->getPolyHeight(polys[0], result, &result[1]))) - return DT_FAILURE; + TC_LOG_DEBUG("maps.mmaps", "Cannot find height at position X: %f Y: %f Z: %f for %s", result[2], result[0], result[1], _sourceUnit->GetDebugInfo()); result[1] += 0.5f; dtVcopy(iterPos, result); |