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:
parent
1ae2b59333
commit
ce084ab1c5
3 changed files with 6 additions and 4 deletions
|
@ -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 () {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -49,7 +49,9 @@ void XMLLoader::load(FGAirportDynamics* d) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
loadAirportXMLDataIntoVisitor(d->getId(), "groundnet", visitor);
|
||||
if(loadAirportXMLDataIntoVisitor(d->getId(), "groundnet", visitor)) {
|
||||
d->init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue