diff --git a/src/DotRecast.Detour/DtNavMeshQuery.cs b/src/DotRecast.Detour/DtNavMeshQuery.cs index 1dce91b..4e9cf18 100644 --- a/src/DotRecast.Detour/DtNavMeshQuery.cs +++ b/src/DotRecast.Detour/DtNavMeshQuery.cs @@ -2808,7 +2808,8 @@ namespace DotRecast.Detour { // Validate input if (!m_nav.IsValidPolyRef(startRef) || !RcVec3f.IsFinite(centerPos) || radius < 0 - || !float.IsFinite(radius) || null == filter) + || !float.IsFinite(radius) || null == filter + || null == resultRef || null == resultParent) { return DtStatus.DT_FAILURE | DtStatus.DT_INVALID_PARAM; } diff --git a/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs b/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs index 3ee0d28..15370dd 100644 --- a/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs +++ b/src/DotRecast.Recast.Demo/Tools/TestNavmeshTool.cs @@ -335,7 +335,14 @@ public class TestNavmeshTool : IRcTool if (m_sposSet && m_startRef != 0) { m_neighbourhoodRadius = _impl.GetSample().GetSettings().agentRadius * 20.0f; - m_navQuery.FindLocalNeighbourhood(m_startRef, m_spos, m_neighbourhoodRadius, m_filter, ref m_polys, ref m_parent); + List resultRef = new(); + List resultParent = new(); + var status = m_navQuery.FindLocalNeighbourhood(m_startRef, m_spos, m_neighbourhoodRadius, m_filter, ref resultRef, ref resultParent); + if (status.Succeeded()) + { + m_polys = resultRef; + m_parent = resultParent; + } } } else if (option.mode == TestNavmeshToolMode.RANDOM_POINTS_IN_CIRCLE)