Potential fix for navmesh query crash when using off-mesh cons and no BV-tree.
This commit is contained in:
parent
336409d037
commit
ff7fd29008
@ -584,10 +584,13 @@ int dtNavMeshQuery::queryPolygonsInTile(const dtMeshTile* tile, const float* qmi
|
|||||||
for (int i = 0; i < tile->header->polyCount; ++i)
|
for (int i = 0; i < tile->header->polyCount; ++i)
|
||||||
{
|
{
|
||||||
const dtPoly* p = &tile->polys[i];
|
const dtPoly* p = &tile->polys[i];
|
||||||
|
// Do not return off-mesh connection polygons.
|
||||||
|
if (p->getType() == DT_POLYTYPE_OFFMESH_CONNECTION)
|
||||||
|
continue;
|
||||||
|
// Must pass filter
|
||||||
const dtPolyRef ref = base | (dtPolyRef)i;
|
const dtPolyRef ref = base | (dtPolyRef)i;
|
||||||
if (!filter->passFilter(ref, tile, p))
|
if (!filter->passFilter(ref, tile, p))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Calc polygon bounds.
|
// Calc polygon bounds.
|
||||||
const float* v = &tile->verts[p->verts[0]*3];
|
const float* v = &tile->verts[p->verts[0]*3];
|
||||||
dtVcopy(bmin, v);
|
dtVcopy(bmin, v);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user