]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.cxx
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / Airports / simple.cxx
index 7eceffe5b583dfd2a91b61d82e9838344bf85c60..a085fab57ab7804084100bb8cea4983decb7672a 100644 (file)
@@ -372,7 +372,7 @@ void FGAirport::loadRunways() const
   }
   
   mRunwaysLoaded = true;
-  loadSceneryDefintions();
+  loadSceneryDefinitions();
 }
 
 void FGAirport::loadTaxiways() const
@@ -399,7 +399,7 @@ void FGAirport::loadProcedures() const
   Route::loadAirportProcedures(path, const_cast<FGAirport*>(this));
 }
 
-void FGAirport::loadSceneryDefintions() const
+void FGAirport::loadSceneryDefinitions() const
 {  
   // allow users to disable the scenery data in the short-term
   // longer term, this option can probably disappear
@@ -456,9 +456,13 @@ void FGAirport::readTowerData(SGPropertyNode* aRoot)
   SGPropertyNode* twrNode = aRoot->getChild("tower")->getChild("twr");
   double lat = twrNode->getDoubleValue("lat"), 
     lon = twrNode->getDoubleValue("lon"), 
-    elevM = twrNode->getDoubleValue("elev-m");
-    
-  _tower_location = SGGeod::fromDegM(lon, lat, elevM);
+    elevM = twrNode->getDoubleValue("elev-m");  
+// tower elevation is AGL, not AMSL. Since we don't want to depend on the
+// scenery for a precise terrain elevation, we use the field elevation
+// (this is also what the apt.dat code does)
+  double fieldElevationM = geod().getElevationM();
+  
+  _tower_location = SGGeod::fromDegM(lon, lat, fieldElevationM + elevM);
 }
 
 bool FGAirport::buildApproach(Waypt* aEnroute, STAR* aSTAR, FGRunway* aRwy, WayptVec& aRoute)