Skip to content
Snippets Groups Projects
Commit 843cb05e authored by Beat Küng's avatar Beat Küng Committed by Lorenz Meier
Browse files

mavlink_mission: fix send_mission_count: must always use MAV_MISSION_TYPE_MISSION

Because it's only used for missions
parent 34e31641
No related branches found
No related tags found
No related merge requests found
......@@ -273,14 +273,16 @@ MavlinkMissionManager::send_mission_ack(uint8_t sysid, uint8_t compid, uint8_t t
void
MavlinkMissionManager::send_mission_current(uint16_t seq)
{
if (seq < current_item_count()) {
unsigned item_count = _count[(uint8_t)MAV_MISSION_TYPE_MISSION];
if (seq < item_count) {
mavlink_mission_current_t wpc;
wpc.seq = seq;
mavlink_msg_mission_current_send_struct(_mavlink->get_channel(), &wpc);
} else if (seq == 0 && current_item_count() == 0) {
} else if (seq == 0 && item_count == 0) {
/* don't broadcast if no WPs */
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment