X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fsimple.cxx;h=a085fab57ab7804084100bb8cea4983decb7672a;hb=c859833c63d410df84cecd86a2a2e4b60a71821c;hp=c7e486f45a56b95cd0ddac27e5179fe9d7a22fa7;hpb=674a295896a1e56d605f39874262d6f146a586a3;p=flightgear.git diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index c7e486f45..a085fab57 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -143,7 +143,10 @@ FGRunway* FGAirport::getRunwayByIdent(const string& aIdent) const FGAirport::Runway_iterator FGAirport::getIteratorForRunwayIdent(const string& aIdent) const -{ +{ + if (aIdent.empty()) + return mRunways.end(); + loadRunways(); string ident(aIdent); @@ -369,7 +372,7 @@ void FGAirport::loadRunways() const } mRunwaysLoaded = true; - loadSceneryDefintions(); + loadSceneryDefinitions(); } void FGAirport::loadTaxiways() const @@ -396,7 +399,7 @@ void FGAirport::loadProcedures() const Route::loadAirportProcedures(path, const_cast(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 @@ -453,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)