- FGEnvironment stationweather =
- ((FGEnvironmentMgr *)globals->get_subsystem("environment"))
- ->getEnvironment(lat, lon, elev);
-
- double hdg = stationweather.get_wind_from_heading_deg();
-
- FGRunway runway;
- if ( globals->get_runways()->search( ident, int(hdg), &runway) ) {
- active_runway = runway._rwy_no;
- active_rw_hdg = runway._heading;
- active_rw_lon = runway._lon;
- active_rw_lat = runway._lat;
- active_rw_len = runway._length;
- //cout << "Active runway is: " << active_runway << " heading = "
- // << active_rw_hdg
- // << " lon = " << active_rw_lon
- // << " lat = " << active_rw_lat <<endl;
- }
- else cout << "FGRunways search failed\n";
+ const FGAirport* apt = fgFindAirportID(ident);
+ assert(apt);
+ FGRunway* runway = apt->getActiveRunwayForUsage();