From 376f4d3116ac9ee3ff71330ebe9156bfae7cfa56 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 10 Jul 2020 01:32:46 +0100 Subject: [PATCH] Fix shadowed declaration in pathfind code --- src/k_pathfind.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/k_pathfind.c b/src/k_pathfind.c index ddea477c8..316eab418 100644 --- a/src/k_pathfind.c +++ b/src/k_pathfind.c @@ -484,24 +484,24 @@ boolean K_PathfindAStar(path_t *const path, pathfindsetup_t *const pathfindsetup // Need to update pointers in closedset, openset, and node "camefrom" if nodesarray moved. if (nodesarray != nodesarrayrealloc) { - size_t i = 0U; + size_t j = 0U; size_t arrayindex = 0U; - for (i = 0U; i < closedsetcount; i++) + for (j = 0U; j < closedsetcount; j++) { - arrayindex = closedset[i] - nodesarray; - closedset[i] = &nodesarrayrealloc[arrayindex]; + arrayindex = closedset[j] - nodesarray; + closedset[j] = &nodesarrayrealloc[arrayindex]; } - for (i = 0U; i < openset.count; i++) + for (j = 0U; j < openset.count; j++) { - arrayindex = ((pathfindnode_t *)(openset.array[i].data)) - nodesarray; - openset.array[i].data = &nodesarrayrealloc[arrayindex]; + arrayindex = ((pathfindnode_t *)(openset.array[j].data)) - nodesarray; + openset.array[j].data = &nodesarrayrealloc[arrayindex]; } - for (i = 0U; i < nodesarraycount; i++) + for (j = 0U; j < nodesarraycount; j++) { - if (nodesarrayrealloc[i].camefrom != NULL) + if (nodesarrayrealloc[j].camefrom != NULL) { - arrayindex = nodesarrayrealloc[i].camefrom - nodesarray; - nodesarrayrealloc[i].camefrom = &nodesarrayrealloc[arrayindex]; + arrayindex = nodesarrayrealloc[j].camefrom - nodesarray; + nodesarrayrealloc[j].camefrom = &nodesarrayrealloc[arrayindex]; } }