FGAIAircraft::dt = dt;
try {
- updatePrimaryTargetValues(); // target hdg, alt, speed
+ if ( !updatePrimaryTargetValues() ) // target hdg, alt, speed
+ return;
}
catch (AI_OutOfSight) {
return;
/**
* Update target values (heading, alt, speed) depending on flight plan or control properties
*/
-void FGAIAircraft::updatePrimaryTargetValues() {
+bool FGAIAircraft::updatePrimaryTargetValues() {
if (fp) // AI object has a flightplan
{
//TODO make this a function of AIBase
}
timeElapsed = now - fp->getStartTime();
if (! fp->isActive(now)) {
- throw FP_Inactive();
+ return false;
}
} else {
// no flight plan, update target heading, speed, and altitude
AccelTo( props->getDoubleValue("controls/flight/target-spd" ) );
}
+ return true;
}
void FGAIAircraft::updatePosition() {