aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-08-18 11:08:06 +0200
committerjackpoz <giacomopoz@gmail.com>2019-08-18 11:08:06 +0200
commit5a980226497605b18f1855fa39f340c10ee9dd53 (patch)
tree9f968e20898d7d4c9d30ba971c0a41e7e00aa7cf
parent7ee0891b0fa4589ba39ad63cc93e760f56d7adf2 (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
-rw-r--r--src/server/game/Movement/PathGenerator.cpp2
1 files changed, 1 insertions, 1 deletions
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);