]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/apt_loader.cxx
Land the GPS/route-manager re-write. Many things are better, many other things will...
[flightgear.git] / src / Airports / apt_loader.cxx
index 36eeabb643e40ab1e9c28df98670811704d86be1..320a5715012b7ee6cf4d81828e9299f511c84150 100644 (file)
@@ -143,7 +143,7 @@ public:
           // frequency entries (ignore)
       } else if ( line_id == 110 ) {
         pavement = true;
-        parsePavementLine850(simgear::strutils::split(line));
+        parsePavementLine850(simgear::strutils::split(line, 0, 4));
       } else if ( line_id >= 111 && line_id <= 114 ) {
         if ( pavement )
           parsePavementNodeLine850(line_id, simgear::strutils::split(line));
@@ -257,7 +257,7 @@ private:
     last_rwy_heading = heading;
 
     int surface_code = atoi( token[10].c_str() );
-    SGGeod pos(SGGeod::fromDegFt(lon, lat, 0.0));
+    SGGeod pos(SGGeod::fromDegFt(lon, lat, last_apt_elev));
     
     if (rwy_no[0] == 'x') {
       // taxiway
@@ -286,6 +286,9 @@ private:
                 displ_thresh2, stopway2, surface_code, true);
 
       runways.push_back(reciprocal);
+      
+      rwy->setReciprocalRunway(reciprocal);
+      reciprocal->setReciprocalRunway(rwy);
     }
   }
 
@@ -335,6 +338,9 @@ private:
               pos, heading_2, length, width, 
               displ_thresh2, stopway2, surface_code, true);
     runways.push_back(reciprocal);
+    
+    rwy->setReciprocalRunway(reciprocal);
+    reciprocal->setReciprocalRunway(rwy);
   }
 
   void parseWaterRunwayLine850(const vector<string>& token)
@@ -373,6 +379,9 @@ private:
               pos, heading_2, length, width, 
               0.0, 0.0, 13, true);
     runways.push_back(reciprocal);
+    
+    rwy->setReciprocalRunway(reciprocal);
+    reciprocal->setReciprocalRunway(rwy);
   }
 
   void parseHelipadLine850(const vector<string>& token)
@@ -403,6 +412,8 @@ private:
   {
     if ( token.size() >= 5 ) {
       pavement_ident = token[4];
+      if ( !pavement_ident.empty() && pavement_ident[pavement_ident.size()-1] == '\r' )
+        pavement_ident.erase( pavement_ident.size()-1 );
     } else {
       pavement_ident = "xx";
     }