Browse Source

Clean up path_next_node.

pull/133/head
Sergey Semushin 7 years ago committed by Anders Jenbo
parent
commit
74da7a9e7e
  1. 24
      Source/path.cpp

24
Source/path.cpp

@ -273,21 +273,23 @@ PATHNODE *path_get_node2(int dx, int dy)
* distance) */
void path_next_node(PATHNODE *pPath)
{
PATHNODE *current; // edx
PATHNODE *next; // eax
current = path_2_nodes;
next = path_2_nodes->NextNode;
if (next != NULL) {
do {
if (next->f >= pPath->f)
break;
PATHNODE *next, *current;
int f;
next = path_2_nodes;
if (path_2_nodes->NextNode) {
current = path_2_nodes;
next = path_2_nodes->NextNode;
f = pPath->f;
while (next && next->f < f) {
current = next;
next = next->NextNode;
} while (next != NULL);
}
pPath->NextNode = next;
current->NextNode = pPath;
} else {
path_2_nodes->NextNode = pPath;
}
current->NextNode = pPath;
}
/* update all path costs using depth-first search starting at pPath */

Loading…
Cancel
Save