]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.cxx
Expose more things to Nasal for FMSs in particular - still work in progress.
[flightgear.git] / src / Airports / simple.cxx
index 92b79005ad756d5a8b3945a8dd2316f5bb534a76..1cf962607748d7ae775b7225645e6a7ead48c14c 100644 (file)
@@ -51,6 +51,8 @@
 #include <ATC/CommStation.hxx>
 
 using std::vector;
+using std::pair;
+
 using namespace flightgear;
 
 // magic import of a helper which uses FGPositioned internals
@@ -76,7 +78,6 @@ FGAirport::FGAirport(const string &id, const SGGeod& location, const SGGeod& tow
 
 FGAirport::~FGAirport()
 {
-    cerr << "Deleting Airport" << endl;
     delete _dynamics;
 }
 
@@ -95,6 +96,15 @@ bool FGAirport::isHeliport() const
   return type() == HELIPORT;
 }
 
+bool FGAirport::isAirportType(FGPositioned* pos)
+{
+    if (!pos) {
+        return false;
+    }
+    
+    return (pos->type() >= AIRPORT) && (pos->type() <= SEAPORT);
+}
+
 FGAirportDynamics * FGAirport::getDynamics()
 {
     if (_dynamics) {
@@ -402,12 +412,6 @@ void FGAirport::loadProcedures() const
 
 void FGAirport::loadSceneryDefinitions() const
 {  
-  // allow users to disable the scenery data in the short-term
-  // longer term, this option can probably disappear
-  if (!fgGetBool("/sim/paths/use-custom-scenery-data")) {
-    return; 
-  }
-  
   SGPath path;
   SGPropertyNode_ptr rootNode = new SGPropertyNode;
   if (XMLLoader::findAirportData(ident(), "threshold", path)) {
@@ -552,7 +556,7 @@ FGAirport::selectSID(const SGGeod& aDest, FGRunway* aRwy)
       << (aRwy ? aRwy->ident() : "no runway preference"));
   }
   
-  return make_pair(sid, enroute);
+  return std::make_pair(sid, enroute);
 }
     
 pair<STAR*, WayptRef>
@@ -584,7 +588,7 @@ FGAirport::selectSTAR(const SGGeod& aOrigin, FGRunway* aRwy)
     }
   } // of STAR iteration
   
-  return make_pair(star, enroute);
+  return std::make_pair(star, enroute);
 }