Fix infinite loop on negative speed.
This commit is contained in:
parent
5ef5ff1b37
commit
a3b01a1c1e
1 changed files with 1 additions and 1 deletions
|
@ -1006,7 +1006,7 @@ bool FGAIShip::advanceFlightPlan (double start_sec, double day_sec) {
|
|||
|
||||
} else {
|
||||
distance_nm = getRange(prev->getLatitude(), prev->getLongitude(), curr->getLatitude(), curr->getLongitude());
|
||||
elapsed_sec += distance_nm * 60 * 60 / prev->getSpeed();
|
||||
elapsed_sec += distance_nm * 60 * 60 / fabs(prev->getSpeed());
|
||||
|
||||
if (elapsed_sec >= day_sec)
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue