From d3ab6c972fe2876e889ddabba81d38884e3526ad Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 14 Feb 2021 01:00:43 +0100 Subject: [PATCH] Avoid set unused position from dtNavMeshQuery::findNearestPoly result --- components/detournavigator/findrandompointaroundcircle.cpp | 3 +-- components/detournavigator/findsmoothpath.hpp | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/components/detournavigator/findrandompointaroundcircle.cpp b/components/detournavigator/findrandompointaroundcircle.cpp index f2e815c918..444050ed7c 100644 --- a/components/detournavigator/findrandompointaroundcircle.cpp +++ b/components/detournavigator/findrandompointaroundcircle.cpp @@ -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; } diff --git a/components/detournavigator/findsmoothpath.hpp b/components/detournavigator/findsmoothpath.hpp index a351f8279c..f757a511f4 100644 --- a/components/detournavigator/findsmoothpath.hpp +++ b/components/detournavigator/findsmoothpath.hpp @@ -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; }