From 5a980226497605b18f1855fa39f340c10ee9dd53 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sun, 18 Aug 2019 11:08:06 +0200 Subject: 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 --- src/server/game/Movement/PathGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 69844b2c15b..a080c2c9336 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -822,7 +822,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); -- cgit v1.2.3