From 9f4ce64458dfae86e1239c525ddc219c4e9e06f1 Mon Sep 17 00:00:00 2001 From: xyd <513619669xyd@gmail.com> Date: Fri, 27 Feb 2026 15:16:52 +0800 Subject: [PATCH] Fix crash on large-scale navmesh generation (assert triggered) (#796) Co-authored-by: yudong xiang --- Recast/Source/RecastMeshDetail.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Recast/Source/RecastMeshDetail.cpp b/Recast/Source/RecastMeshDetail.cpp index 40d350f2..07bbdbd5 100644 --- a/Recast/Source/RecastMeshDetail.cpp +++ b/Recast/Source/RecastMeshDetail.cpp @@ -878,6 +878,7 @@ static bool buildPolyDetail(rcContext* ctx, const float* in, const int nin, pt[0] = s[0]*sampleDist + getJitterX(i)*cs*0.1f; pt[1] = s[1]*chf.ch; pt[2] = s[2]*sampleDist + getJitterY(i)*cs*0.1f; + if (tris.size() == 0) continue; float d = distToTriMesh(pt, verts, nverts, &tris[0], static_cast(tris.size()) / 4); if (d < 0) continue; // did not hit the mesh. if (d > bestd)