]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/atc_mgr.cxx
Tolerate the lack of a GUI in some places.
[flightgear.git] / src / ATC / atc_mgr.cxx
index dc5005e70b0d0826c661597bc88c73150d39ef31..c4372173934b045cf55d3bd36d82dfc292997f8e 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <iostream>
 
-#include <simgear/math/SGMath.hxx>
 #include <Airports/dynamics.hxx>
 #include <Airports/simple.hxx>
 #include <Scenery/scenery.hxx>
@@ -111,8 +110,11 @@ void FGATCManager::init() {
             if (!runway.empty()) {
                 controller = apt->getDynamics()->getTowerController();
                 int stationFreq = apt->getDynamics()->getTowerFrequency(2);
-                //cerr << "Setting radio frequency to in airfrequency: " << stationFreq << endl;
-                fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
+                if (stationFreq > 0)
+                {
+                    //cerr << "Setting radio frequency to in airfrequency: " << stationFreq << endl;
+                    fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
+                }
                 leg = 3;
                 string fltType = "ga";
                 fp->setRunway(runway);
@@ -124,8 +126,11 @@ void FGATCManager::init() {
         } else {
             controller = apt->getDynamics()->getStartupController();
             int stationFreq = apt->getDynamics()->getGroundFrequency(1);
-            //cerr << "Setting radio frequency to : " << stationFreq << endl;
-            fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
+            if (stationFreq > 0)
+            {
+                //cerr << "Setting radio frequency to : " << stationFreq << endl;
+                fgSetDouble("/instrumentation/comm[0]/frequencies/selected-mhz", ((double) stationFreq / 100.0));
+            }
             leg = 1;
             //double, lat, lon, head; // Unused variables;
             //int getId = apt->getDynamics()->getParking(gateId, &lat, &lon, &head);
@@ -138,8 +143,6 @@ void FGATCManager::init() {
             if (!(fp->createPushBack(&ai_ac,
                                false, 
                                apt, 
-                               latitude,
-                               longitude,
                                aircraftRadius,
                                fltType,
                                aircraftType,