1
0
Fork 0

Two minor (codewise) fixes to ensure everything works as advertised:

- Make sure to initialize the groundnetwork after succesful loading.
 - Ensure that the AI groundnetwork code proximity detection code used the
   correct values for bearing. (Note that detecting the proximity of the
   user aircraft appears still to be broken. I'll look into that later).
This commit is contained in:
durk 2009-08-30 14:39:04 +00:00 committed by Tim Moore
parent 1ae2b59333
commit ce084ab1c5
3 changed files with 6 additions and 4 deletions

View file

@ -25,7 +25,7 @@ FGAirportDynamicsXMLLoader::FGAirportDynamicsXMLLoader(FGAirportDynamics* dyn):
XMLVisitor(), _dynamics(dyn) {}
void FGAirportDynamicsXMLLoader::startXML () {
//cout << "Start XML" << endl;
//cout << "FGAirportDynamicsLoader::Start XML" << endl;
}
void FGAirportDynamicsXMLLoader::endXML () {

View file

@ -606,7 +606,7 @@ void FGGroundNetwork::checkSpeedAdjustment(int id, double lat,
SGGeod other(SGGeod::fromDegM(i->getLongitude(),
i->getLatitude(), i->getAltitude()));
SGGeodesy::inverse(other, curr, course, az2, dist);
SGGeodesy::inverse(curr, other, course, az2, dist);
bearing = fabs(heading-course);
if (bearing > 180)
bearing = 360-bearing;
@ -626,7 +626,7 @@ void FGGroundNetwork::checkSpeedAdjustment(int id, double lat,
//cerr << "Comparing " << current->getId() << " and " << i->getId() << endl;
SGGeod other(SGGeod::fromDegM(i->getLongitude(),
i->getLatitude(), i->getAltitude()));
SGGeodesy::inverse(other, curr, course, az2, dist);
SGGeodesy::inverse(curr, other, course, az2, dist);
bearing = fabs(heading-course);
if (bearing > 180)
bearing = 360-bearing;

View file

@ -49,7 +49,9 @@ void XMLLoader::load(FGAirportDynamics* d) {
}
}
} else {
loadAirportXMLDataIntoVisitor(d->getId(), "groundnet", visitor);
if(loadAirportXMLDataIntoVisitor(d->getId(), "groundnet", visitor)) {
d->init();
}
}
}