summaryrefslogtreecommitdiff
path: root/digital/io-hub/src/guybrush
diff options
context:
space:
mode:
authorNicolas Schodet2012-05-14 13:32:44 +0200
committerNicolas Schodet2012-05-14 13:32:44 +0200
commit6db6a923128b3f9c45820508c41f2fdbc0edfe58 (patch)
tree99349fc64fa9d5d59598477471e525c5e83537b9 /digital/io-hub/src/guybrush
parentbed39ab7e7b82dac49befaa9dcc6a672a64fe897 (diff)
digital/io-hub/src/guybrush: fix path optimization
Diffstat (limited to 'digital/io-hub/src/guybrush')
-rw-r--r--digital/io-hub/src/guybrush/path.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/digital/io-hub/src/guybrush/path.c b/digital/io-hub/src/guybrush/path.c
index 81a2270e..1ec32940 100644
--- a/digital/io-hub/src/guybrush/path.c
+++ b/digital/io-hub/src/guybrush/path.c
@@ -385,17 +385,13 @@ path_optimize (void)
vect_t curp, nextp, next2p;
path_pos (cur, &curp);
next = path.astar_nodes[cur].prev;
- if (next == 0xff || next == PATH_DST_NODE_INDEX)
- return;
path_pos (next, &nextp);
/* Look at three points, if they are aligned, remove the center point. */
- while (1)
+ while (next != 0xff && next != PATH_DST_NODE_INDEX)
{
/* Nodes: cur ---> next ---> next2. Do not be fooled by the "prev"
* name, astar is feed backward. */
next2 = path.astar_nodes[next].prev;
- if (next2 == 0xff || next2 == PATH_DST_NODE_INDEX)
- break;
path_pos (next2, &next2p);
vect_t vnp = nextp; vect_sub (&vnp, &curp);
vect_t vn2p = next2p; vect_sub (&vn2p, &curp);