diff --git a/libraries/AP_GPS/AP_GPS_MAV.cpp b/libraries/AP_GPS/AP_GPS_MAV.cpp index 1b883a9de015f5..1a88c6abd297a4 100644 --- a/libraries/AP_GPS/AP_GPS_MAV.cpp +++ b/libraries/AP_GPS/AP_GPS_MAV.cpp @@ -49,7 +49,9 @@ void AP_GPS_MAV::handle_msg(const mavlink_message_t &msg) // check if target instatce belong to incoming gps data. if (state.instance != packet.gps_id) + { return; + } bool have_alt = ((packet.ignore_flags & GPS_INPUT_IGNORE_FLAG_ALT) == 0); bool have_hdop = ((packet.ignore_flags & GPS_INPUT_IGNORE_FLAG_HDOP) == 0); @@ -150,7 +152,9 @@ void AP_GPS_MAV::handle_msg(const mavlink_message_t &msg) // check if target instatce belong to incoming gps data. if (state.instance != packet.id) + { return; + } state.time_week = 0; state.time_week_ms = packet.time_usec/1000;