diff --git a/src/common/Collision/Management/MMapManager.cpp b/src/common/Collision/Management/MMapManager.cpp index f581db5..76997ae 100644 --- a/src/common/Collision/Management/MMapManager.cpp +++ b/src/common/Collision/Management/MMapManager.cpp @@ -254,7 +254,7 @@ namespace MMAP // allocate mesh query dtNavMeshQuery* query = dtAllocNavMeshQuery(); ASSERT(query); - if (dtStatusFailed(query->init(mmap->navMesh, 1024))) + if (dtStatusFailed(query->init(mmap->navMesh, 2048))) // 1024 -> 2048 : les tres longs chemins echouaient faute de budget de noeuds Detour (LegionCore-Reforged 814091a) { dtFreeNavMeshQuery(query); TC_LOG_ERROR("maps", "MMAP:GetNavMeshQuery: Failed to initialize dtNavMeshQuery for mapId %04u instanceId %u", mapId, instanceId); diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 12d7494..e0068ee 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -248,6 +248,13 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con else { float closestPoint[VERTEX_SIZE]; + // recale aussi le point de DEPART sur son poly quand l unite est au-dessus du navmesh + // (debout sur un GO : quai, caisse, plateforme) : sans ce recalage findPath part d un + // point errone et produit un chemin aberrant (LegionCore-Reforged 814091a) + if (distToStartPoly > 7.0f) + if (dtStatusSucceed(_navMeshQuery->closestPointOnPoly(startPoly, startPoint, closestPoint, NULL))) + dtVcopy(startPoint, closestPoint); + // we may want to use closestPointOnPolyBoundary instead if (dtStatusSucceed(_navMeshQuery->closestPointOnPoly(endPoly, endPoint, closestPoint, NULL))) {