]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.cxx
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / Airports / simple.cxx
index 1b7d1c9d0b5fb517aaa8cf02642a1f4ea1ef48c8..af16923b3469507a8b5e0487aaab7e595e8f136e 100644 (file)
@@ -250,13 +250,17 @@ FGRunway* FGAirport::getActiveRunwayForUsage() const
     envMgr = (FGEnvironmentMgr *) globals->get_subsystem("environment");
   }
   
-  FGEnvironment stationWeather(envMgr->getEnvironment(mPosition));
+  // This forces West-facing rwys to be used in no-wind situations
+  // which is consistent with Flightgear's initial setup.
+  double hdg = 270;
   
-  double windSpeed = stationWeather.get_wind_speed_kt();
-  double hdg = stationWeather.get_wind_from_heading_deg();
-  if (windSpeed <= 0.0) {
-    hdg = 270; // This forces West-facing rwys to be used in no-wind situations
-    // which is consistent with Flightgear's initial setup.
+  if (envMgr) {
+    FGEnvironment stationWeather(envMgr->getEnvironment(mPosition));
+  
+    double windSpeed = stationWeather.get_wind_speed_kt();
+    if (windSpeed > 0.0) {
+      hdg = stationWeather.get_wind_from_heading_deg();
+    }
   }
   
   return findBestRunwayForHeading(hdg);
@@ -347,7 +351,7 @@ void FGAirport::loadSceneryDefintions() const
 {  
   // allow users to disable the scenery data in the short-term
   // longer term, this option can probably disappear
-  if (!fgGetBool("/sim/use-scenery-airport-data")) {
+  if (!fgGetBool("/sim/paths/use-custom-scenery-data")) {
     return; 
   }