]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/dynamics.cxx
Another clean-up iteration: FGAirportList::search is gone, replaced by two
[flightgear.git] / src / Airports / dynamics.cxx
index 868c45cea171ed7e596bdc622f5f5def44dd7fbe..5f41b8d9ecfeb09571763c397e0f88ca06513b40 100644 (file)
 #include <string>
 #include <vector>
 
-SG_USING_STD(string);
-SG_USING_STD(vector);
-SG_USING_STD(sort);
-SG_USING_STD(random_shuffle);
+using std::string;
+using std::vector;
+using std::sort;
+using std::random_shuffle;
 
 #include "simple.hxx"
 #include "dynamics.hxx"
@@ -419,7 +419,7 @@ void FGAirportDynamics::getActiveRunway(const string &trafficType, int action, s
           currentlyActive = &ulActive;
         }
          // 
-         currRunwayGroup->setActive(_ap->getId()
+         currRunwayGroup->setActive(_ap, 
                                     windSpeed, 
                                     windHeading, 
                                     maxTail, 
@@ -485,20 +485,8 @@ void FGAirportDynamics::getActiveRunway(const string &trafficType, int action, s
 
 string FGAirportDynamics::chooseRunwayFallback()
 {   
-  FGEnvironment 
-    stationweather = ((FGEnvironmentMgr *) globals->get_subsystem("environment"))
-    ->getEnvironment(getLatitude(), 
-                    getLongitude(),
-                    getElevation());
-  
-  double windSpeed = stationweather.get_wind_speed_kt();
-  double windHeading = stationweather.get_wind_from_heading_deg();
-  if (windSpeed == 0) {
-    windHeading = 270; // This forces West-facing rwys to be used in no-wind situations
-    //which is consistent with Flightgear's initial setup.
-  }
-  
-   return globals->get_runways()->search(_ap->getId(), int(windHeading));
+  FGRunway* rwy = _ap->getActiveRunwayForUsage();
+  return rwy->ident();
 }
 
 void FGAirportDynamics::addParking(FGParking& park) {