Fix rare crash in naveditor

Running tests in the naveditor without building navigation segfaults the application.

Reduced verbose prints when building navigation.
This commit is contained in:
Kawe Mazidjatari 2022-04-22 02:31:06 +02:00
parent 3ad668e37a
commit a778d910e7
2 changed files with 3 additions and 4 deletions

View File

@ -440,10 +440,9 @@ bool dtCreateNavMeshData(dtNavMeshCreateParams* params, unsigned char** outData,
detailMeshesSize + detailVertsSize + detailTrisSize +
bvTreeSize + offMeshConsSize+ sthSize;
printf("%i %i %i %i(%i links) %i %i %i %i %i\n", headerSize, vertsSize, polysSize, linksSize, maxLinkCount, detailMeshesSize, detailVertsSize, detailTrisSize, bvTreeSize, offMeshConsSize);
//printf("%i %i %i %i(%i links) %i %i %i %i %i\n", headerSize, vertsSize, polysSize, linksSize, maxLinkCount, detailMeshesSize, detailVertsSize, detailTrisSize, bvTreeSize, offMeshConsSize);
//printf("%i\n", dataSize);
printf("%i\n", dataSize);
unsigned char* data = (unsigned char*)dtAlloc(sizeof(unsigned char)*dataSize, DT_ALLOC_PERM);
if (!data)
{

View File

@ -223,7 +223,7 @@ dtStatus dtNavMeshQuery::findRandomPoint(const dtQueryFilter* filter, float (*fr
{
dtAssert(m_nav);
if (!filter || !frand || !randomRef || !randomPt)
if (!m_nav || !filter || !frand || !randomRef || !randomPt)
return DT_FAILURE | DT_INVALID_PARAM;
// Randomly pick one tile. Assume that all tiles cover roughly the same area.