Hotfix for current active waypoint ID

This commit is contained in:
Lorenz Meier
2013-01-14 23:48:07 +01:00
parent 38f435e4cf
commit 35f0f570a6
+4 -3
View File
@@ -408,9 +408,10 @@ void check_waypoints_reached(uint64_t now, const struct vehicle_global_position_
cur_wp->current = 0;
if (wpm->current_active_wp_id == wpm->size - 1 && wpm->size > 1) {
//the last waypoint was reached, if auto continue is
//activated restart the waypoint list from the beginning
wpm->current_active_wp_id = 1;
/* the last waypoint was reached, if auto continue is
* activated restart the waypoint list from the beginning
*/
wpm->current_active_wp_id = 0;
} else {
if ((uint16_t)(wpm->current_active_wp_id + 1) < wpm->size)