bool getInteriorLoaded(void) { return _interiorLoaded;}
bool hasInteriorPath(void) { return _hasInteriorPath;}
inline std::string& getInteriorPath() { return _interiorPath; }
-
private:
std::auto_ptr<FGNasalModelDataProxy> _nasal;
std::string _fxpath;
return id;
}
-
-
+bool FGAIBase::isValid() {
+ //Either no flightplan or it is valid
+ return !fp || fp->isValidPlan();
+}
int _getSubID() const;
bool getDie();
+ bool isValid();
SGVec3d getCartPosAt(const SGVec3d& off) const;
SGVec3d getCartPos() const;
wpt->setFinished ((wpt->getName() == "END"));
pushBackWaypoint( wpt );
}
+ if( getLastWaypoint()->getName().compare("END") != 0 ) {
+ SG_LOG(SG_AI, SG_ALERT, "FGAIFlightPlan::Flightplan missing END node" );
+ return false;
+ }
+
wpt_iterator = waypoints.begin();
return true;
public:
wpt_vector_iterator getFirstWayPoint() { return waypoints.begin(); };
wpt_vector_iterator getLastWayPoint() { return waypoints.end(); };
- bool isValidPlan() { return isValid; };
+ bool isValidPlan() { return isValid; };
};
#endif // _FG_AIFLIGHTPLAN_HXX
}
ai->readFromScenario(const_cast<SGPropertyNode*>(definition));
- attach(ai);
+ if((ai->isValid())){
+ attach(ai);
+ SG_LOG(SG_AI, SG_DEBUG, "attached scenario " << ai->_getName());
+ }
+ else{
+ ai->setDie(true);
+ SG_LOG(SG_AI, SG_ALERT, "killed invalid scenario " << ai->_getName());
+ }
return ai;
}