Fixed crash in case building malformed detail mesh data.

This commit is contained in:
Mikko Mononen 2009-10-23 12:54:28 +00:00
parent 6e8581400a
commit 02477f981f

View File

@ -330,7 +330,7 @@ bool dtCreateNavMeshData(const unsigned short* verts, const int nverts,
dtl.tbase = dmeshes[i*4+2];
dtl.ntris = dmeshes[i*4+3];
// Copy vertices except the first 'nv' verts which are equal to nav poly verts.
if (ndv-nv)
if (ndv-nv > 0)
{
memcpy(&navDVerts[vbase*3], &dverts[(vb+nv)*3], sizeof(float)*3*(ndv-nv));
vbase += ndv-nv;