diff --git a/src/comm/QGCFlightGearLink.cc b/src/comm/QGCFlightGearLink.cc index 1c015a7094d2ade2a294c89e45f60e191f9a6c47..2c5252998378f2a9cf505a89e1a1392b4d9539f1 100644 --- a/src/comm/QGCFlightGearLink.cc +++ b/src/comm/QGCFlightGearLink.cc @@ -279,6 +279,7 @@ bool QGCFlightGearLink::disconnectSimulation() **/ bool QGCFlightGearLink::connectSimulation() { + if (!mav) return false; socket = new QUdpSocket(this); //Check if we are using a multicast-address @@ -377,6 +378,8 @@ processCall << "--disable-random-objects"; processCall << "--disable-ai-models"; processCall << "--wind=0@0"; processCall << "--fdm=jsb"; +processCall << QString("--lat=%1").arg(mav->getLatitude()); +processCall << QString("--lon=%1").arg(mav->getLongitude()); // Add new argument with this: processCall << ""; processCall << QString("--aircraft=%2").arg(aircraft);