1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-01 06:09:42 +00:00

Avoid set unused position from dtNavMeshQuery::findNearestPoly result

This commit is contained in:
elsid 2021-02-14 01:00:43 +01:00
parent 4d3df56bf3
commit d3ab6c972f
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
2 changed files with 3 additions and 6 deletions

View file

@ -21,11 +21,10 @@ namespace DetourNavigator
queryFilter.setIncludeFlags(includeFlags);
dtPolyRef startRef = 0;
osg::Vec3f startPolygonPosition;
for (int i = 0; i < 3; ++i)
{
const auto status = navMeshQuery.findNearestPoly(start.ptr(), (halfExtents * (1 << i)).ptr(), &queryFilter,
&startRef, startPolygonPosition.ptr());
&startRef, nullptr);
if (!dtStatusFailed(status) && startRef != 0)
break;
}

View file

@ -283,11 +283,10 @@ namespace DetourNavigator
queryFilter.setAreaCost(AreaType_ground, areaCosts.mGround);
dtPolyRef startRef = 0;
osg::Vec3f startPolygonPosition;
for (int i = 0; i < 3; ++i)
{
const auto status = navMeshQuery.findNearestPoly(start.ptr(), (halfExtents * (1 << i)).ptr(), &queryFilter,
&startRef, startPolygonPosition.ptr());
&startRef, nullptr);
if (!dtStatusFailed(status) && startRef != 0)
break;
}
@ -296,11 +295,10 @@ namespace DetourNavigator
return Status::StartPolygonNotFound;
dtPolyRef endRef = 0;
osg::Vec3f endPolygonPosition;
for (int i = 0; i < 3; ++i)
{
const auto status = navMeshQuery.findNearestPoly(end.ptr(), (halfExtents * (1 << i)).ptr(), &queryFilter,
&endRef, endPolygonPosition.ptr());
&endRef, nullptr);
if (!dtStatusFailed(status) && endRef != 0)
break;
}