From 35f0f570a6c0434c77db50407a7510677c1fb889 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 14 Jan 2013 23:48:07 +0100 Subject: [PATCH] Hotfix for current active waypoint ID --- apps/mavlink/waypoints.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/mavlink/waypoints.c b/apps/mavlink/waypoints.c index 3832ebe708..a131b143ba 100644 --- a/apps/mavlink/waypoints.c +++ b/apps/mavlink/waypoints.c @@ -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)