mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'pathfind-shadowed-declaration' into 'master'
Fix shadowed declaration in pathfind code See merge request KartKrew/Kart!294
This commit is contained in:
commit
ae249b2f67
1 changed files with 11 additions and 11 deletions
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue