From 7ef22e43057080926685eb45f0fce3f2f3d58c61 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 18 Nov 2017 15:35:44 +0100 Subject: Dep/Recast: Update recastnavigation to https://github.com/recastnavigation/recastnavigation/commit/2c85309280dbc9c82029e7ab16dfb01b9235c74e --- dep/recastnavigation/Detour/Source/DetourCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dep/recastnavigation/Detour/Source/DetourCommon.cpp') diff --git a/dep/recastnavigation/Detour/Source/DetourCommon.cpp b/dep/recastnavigation/Detour/Source/DetourCommon.cpp index 26fe65c1781..41d0d7bd387 100644 --- a/dep/recastnavigation/Detour/Source/DetourCommon.cpp +++ b/dep/recastnavigation/Detour/Source/DetourCommon.cpp @@ -342,8 +342,8 @@ void dtRandomPointInConvexPoly(const float* pts, const int npts, float* areas, // Find sub triangle weighted by area. const float thr = s*areasum; float acc = 0.0f; - float u = 0.0f; - int tri = 0; + float u = 1.0f; + int tri = npts - 1; for (int i = 2; i < npts; i++) { const float dacc = areas[i]; if (thr >= acc && thr < (acc+dacc)) -- cgit v1.2.3