X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fsimple.cxx;h=249e5a72b40a8fa51cfaafd365e780524b32cfd6;hb=71fbacc6dc5afe0eda851c9b1a42d73a3ed463db;hp=bf6620f945fd9cf42d1abc2b8f170e8ea6d171ca;hpb=7ff374ef8bce34aa5de0e525915f5e9091e6561b;p=flightgear.git diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index bf6620f94..249e5a72b 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -30,6 +30,8 @@ #include "simple.hxx" +#include + #include #include #include @@ -250,13 +252,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; + + if (envMgr) { + FGEnvironment stationWeather(envMgr->getEnvironment(mPosition)); - 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. + double windSpeed = stationWeather.get_wind_speed_kt(); + if (windSpeed > 0.0) { + hdg = stationWeather.get_wind_from_heading_deg(); + } } return findBestRunwayForHeading(hdg); @@ -290,7 +296,7 @@ bool FGAirport::HardSurfaceFilter::passAirport(FGAirport* aApt) const FGAirport* FGAirport::findByIdent(const std::string& aIdent) { FGPositionedRef r; - AirportFilter filter; + PortsFilter filter; r = FGPositioned::findNextWithPartialId(r, aIdent, &filter); if (!r) { return NULL; // we don't warn here, let the caller do that @@ -301,7 +307,7 @@ FGAirport* FGAirport::findByIdent(const std::string& aIdent) FGAirport* FGAirport::getByIdent(const std::string& aIdent) { FGPositionedRef r; - AirportFilter filter; + PortsFilter filter; r = FGPositioned::findNextWithPartialId(r, aIdent, &filter); if (!r) { throw sg_range_exception("No such airport with ident: " + aIdent); @@ -347,7 +353,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; }