1
0
Fork 0

RNAV: use runway departure end for previous wpt.

Should fix leg computation following a runway waypt.
This commit is contained in:
James Turner 2015-01-10 19:35:11 +00:00
parent 6b9aa0fb97
commit cc2a78b70b

View file

@ -462,11 +462,18 @@ SGGeod GPS::previousLegWaypointPosition(bool& isValid)
FlightPlan::Leg* leg = _route->previousLeg();
if (leg){
Waypt* waypt = leg->waypoint();
if(waypt){
if (waypt) {
isValid = true;
// ensure computations use runway end, not threshold
if (waypt->type() == "runway") {
RunwayWaypt* rwpt = static_cast<RunwayWaypt*>(waypt);
return rwpt->runway()->end();
}
return waypt->position();
}
}
isValid = false;
return SGGeod();
}