]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/atc_mgr.cxx
Implement a persistent cache for navigation data.
[flightgear.git] / src / ATC / atc_mgr.cxx
index dc5005e70b0d0826c661597bc88c73150d39ef31..3b727c903cea81cd3bd47df09a63a545441d92c8 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);