1
0
Fork 0

James Turner :

If someone could kindly apply the attached patch, that'll keep this from crashing, I believe. The fix is easy since FGAirport can now always provide an active runway - there's no need to guess at random, or rely on the tower having set one up.
This commit is contained in:
fredb 2008-09-07 08:44:48 +00:00
parent 4f071a9207
commit 2b0588d170

View file

@ -165,18 +165,9 @@ void FGAILocalTraffic::GetAirportDetails(const string& id) {
void FGAILocalTraffic::GetRwyDetails(const string& id) {
//cout << "GetRwyDetails called" << endl;
if(_controlled) {
rwy.rwyID = tower->GetActiveRunway();
} else {
// TODO - get a proper runway ID from uncontrolled airports
rwy.rwyID = "00";
}
// Now we need to get the threshold position and rwy heading
const FGAirport* apt = fgFindAirportID(id);
assert(apt);
FGRunway runway(apt->getRunwayByIdent(rwy.rwyID));
FGRunway runway(apt->getActiveRunwayForUsage());
double hdg = runway._heading;
double other_way = hdg - 180.0;