1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-01 10:39: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); queryFilter.setIncludeFlags(includeFlags);
dtPolyRef startRef = 0; dtPolyRef startRef = 0;
osg::Vec3f startPolygonPosition;
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
{ {
const auto status = navMeshQuery.findNearestPoly(start.ptr(), (halfExtents * (1 << i)).ptr(), &queryFilter, const auto status = navMeshQuery.findNearestPoly(start.ptr(), (halfExtents * (1 << i)).ptr(), &queryFilter,
&startRef, startPolygonPosition.ptr()); &startRef, nullptr);
if (!dtStatusFailed(status) && startRef != 0) if (!dtStatusFailed(status) && startRef != 0)
break; break;
} }

View file

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