navmesh variable name change

This commit is contained in:
Priyatham Sai Chand 2022-11-08 22:47:32 -08:00
parent 5ba7f9feb2
commit 262667e8dd
No known key found for this signature in database
GPG Key ID: 5DF163EB5A38175B
1 changed files with 8 additions and 11 deletions

View File

@ -265,28 +265,25 @@ class NavMesh
} }
PVector index_point = vertices.get(convex_index);
int next_index = convex_index + 1; int next_index = convex_index + 1;
if (next_index >= vertices.size()) next_index = 0; if (next_index >= vertices.size()) next_index = 0;
int lastIndex = convex_index - 1; int last_index = convex_index - 1;
if (lastIndex < 0) lastIndex = vertices.size() - 1; if (last_index < 0) last_index = vertices.size() - 1;
for (int conn_point = vertices.size()-1; conn_point>=0; conn_point--) for (int i = vertices.size()-1; i>=0; i--)
{ {
if (conn_point == next_index || conn_point == convex_index || conn_point == lastIndex) continue; if (i == next_index || i == convex_index || i == last_index) continue;
PVector conn_pointPoint = vertices.get(conn_point); PVector point_vertex = vertices.get(i);
if (!intersectsWall(pointAtIndex, conn_pointPoint)) if (!intersectsWall(index_point, point_vertex))
{ {
return conn_point; return i;
} }
} }