diff --git a/src/MissionManager/MissionController.cc b/src/MissionManager/MissionController.cc index 33c137852beb9feb93941130d321eefa02e65c55..375b51801992ed3b97d345b1a15fb91ba922a482 100644 --- a/src/MissionManager/MissionController.cc +++ b/src/MissionManager/MissionController.cc @@ -412,8 +412,8 @@ int MissionController::insertComplexMissionItem(QString itemName, QGeoCoordinate // If the ComplexMissionItem is inserted first, add a TakeOff SimpleMissionItem if (_visualItems->count() == 1 && (_controllerVehicle->fixedWing() || _controllerVehicle->vtol() || _controllerVehicle->multiRotor())) { - insertSimpleMissionItem(mapCenterCoordinate, i); - i++; + insertSimpleMissionItem(mapCenterCoordinate, visualItemIndex); + visualItemIndex++; } int sequenceNumber = _nextSequenceNumber();