From 3d2cb74e2c2969148f4ad9b161f66b696b6e6dd7 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 10 Jun 2023 22:41:50 +0900 Subject: [PATCH] bugfix - reset randomRef, randomPt --- src/DotRecast.Detour/DtNavMeshQuery.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DotRecast.Detour/DtNavMeshQuery.cs b/src/DotRecast.Detour/DtNavMeshQuery.cs index 3215eeb..478268e 100644 --- a/src/DotRecast.Detour/DtNavMeshQuery.cs +++ b/src/DotRecast.Detour/DtNavMeshQuery.cs @@ -411,7 +411,9 @@ namespace DotRecast.Detour float[] areas = new float[randomPolyVerts.Length / 3]; RcVec3f pt = DetourCommon.RandomPointInConvexPoly(randomPolyVerts, randomPolyVerts.Length / 3, areas, s, t); ClosestPointOnPoly(randomPolyRef, pt, out var closest, out var _); - Results.Success(new FindRandomPointResult(randomPolyRef, closest)); + + randomRef = randomPolyRef; + randomPt = closest; return status; }