]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/positioninit.cxx
Implement a persistent cache for navigation data.
[flightgear.git] / src / Main / positioninit.cxx
index 3a9aaca7ec053c983e06f9d3bcfc78fc5e6a2d38..f5d43ac6e0f57640212560f01348a44b70eade9a 100644 (file)
@@ -307,10 +307,10 @@ static void fgSetDistOrAltFromGlideSlope() {
 
 
 // Set current_options lon/lat given an airport id and heading (degrees)
-static bool fgSetPosFromNAV( const string& id, const double& freq, FGPositioned::Type type ) {
-  
-  const nav_list_type navlist
-  = globals->get_navlist()->findByIdentAndFreq( id.c_str(), freq, type );
+static bool fgSetPosFromNAV( const string& id, const double& freq, FGPositioned::Type type )
+{
+  FGNavList::TypeFilter filter(type);
+  const nav_list_type navlist = FGNavList::findByIdentAndFreq( id.c_str(), freq, &filter );
   
   if (navlist.size() == 0 ) {
     SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate NAV = "
@@ -387,7 +387,7 @@ static bool fgSetPosFromCarrier( const string& carrier, const string& posid ) {
 static bool fgSetPosFromFix( const string& id )
 {
   FGPositioned::TypeFilter fixFilter(FGPositioned::FIX);
-  FGPositioned* fix = FGPositioned::findNextWithPartialId(NULL, id, &fixFilter);
+  FGPositioned* fix = FGPositioned::findFirstWithIdent(id, &fixFilter);
   if (!fix) {
     SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate fix = " << id );
     return false;