void FGAIManager::processScenario( string filename ) {
FGAIScenario* s = new FGAIScenario( filename );
-
for (int i=0;i<s->nEntries();i++) {
FGAIModelEntity* en = s->getNextEntry();
if (en) {
- en->fp = NULL;
- if (en->flightplan != ""){
- en->fp = new FGAIFlightPlan( en->flightplan );
- }
+
if (en->m_class == "aircraft") {
createAircraft( en );
#include <Main/fg_props.hxx>
#include "AIScenario.hxx"
+#include "AIFlightPlan.hxx"
return;
}
+ entries.clear();
SGPropertyNode * node = root.getNode("scenario");
for (i = 0; i < node->nChildren(); i++) {
//cout << "Reading entry " << i << endl;
en->wind_from_east = entry_node->getDoubleValue("wind_from_east", 0);
en->wind_from_north = entry_node->getDoubleValue("wind_from_north", 0);
en->wind = entry_node->getBoolValue("wind", false);
- en->cd = entry_node->getDoubleValue ("cd", 0.029);
- en->weight = entry_node->getDoubleValue ("weight", 0.030);
+ en->cd = entry_node->getDoubleValue ("cd", 0.029);
+ en->weight = entry_node->getDoubleValue ("weight", 0.030);
+
en->fp = NULL;
+ if (en->flightplan != ""){
+ en->fp = new FGAIFlightPlan( en->flightplan );
+ }
}
entry_iterator = entries.begin();