1
0
Fork 0

AI Fix a crash where a valid flightplan is assumed

Sentry-Id: FLIGHTGEAR-GX
This commit is contained in:
James Turner 2020-10-26 16:03:21 +00:00
parent f2a108945d
commit 7510f7d487

View file

@ -1231,7 +1231,7 @@ void FGAIAircraft::updateVerticalSpeedTarget(double dt) {
} else {
tgt_vs = std::max(tgt_altitude_ft - altitude_ft, -_performance->descentRate());
}
} else {
} else if (fp) {
double vert_dist_ft = fp->getCurrentWaypoint()->getCrossat() - altitude_ft;
double err_dist = 0; //prev->getCrossat() - altitude_ft;
double dist_m = fp->getDistanceToGo(pos.getLatitudeDeg(), pos.getLongitudeDeg(), fp->getCurrentWaypoint());