AP_Terrain: don't request data at 0/0

This commit is contained in:
Andrew Tridgell 2014-08-06 22:13:37 +10:00
parent 642a07b6bd
commit f0f46a77d7
1 changed files with 3 additions and 2 deletions

View File

@ -65,8 +65,9 @@ void AP_Terrain::update_mission_data(void)
// we only want nav waypoint commands. That should be enough to // we only want nav waypoint commands. That should be enough to
// prefill the terrain data and makes many things much simpler // prefill the terrain data and makes many things much simpler
while (cmd.id != MAV_CMD_NAV_WAYPOINT && while ((cmd.id != MAV_CMD_NAV_WAYPOINT &&
cmd.id != MAV_CMD_NAV_SPLINE_WAYPOINT) { cmd.id != MAV_CMD_NAV_SPLINE_WAYPOINT) ||
(cmd.content.location.lat == 0 && cmd.content.location.lng == 0)) {
next_mission_index++; next_mission_index++;
if (!mission.read_cmd_from_storage(next_mission_index, cmd)) { if (!mission.read_cmd_from_storage(next_mission_index, cmd)) {
// nothing more to do // nothing more to do