mavlink_mission: fix send_mission_count: must always use MAV_MISSION_TYPE_MISSION

Because it's only used for missions
This commit is contained in:
Beat Küng 2017-06-29 11:16:30 +02:00 committed by Lorenz Meier
parent 34e31641ab
commit 843cb05ef4
1 changed files with 4 additions and 2 deletions

View File

@ -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 {