1
0
Fork 0

Make the scenarios work again.

This commit is contained in:
ehofman 2004-09-22 11:24:45 +00:00
parent 9d1b5164e2
commit 82dfd908b7
2 changed files with 9 additions and 9 deletions

View file

@ -64,8 +64,8 @@ void FGAIManager::init() {
wind_from_down_node = fgGetNode("/environment/wind-from-down-fps", true); wind_from_down_node = fgGetNode("/environment/wind-from-down-fps", true);
scenario_filename = root->getNode("scenario", true)->getStringValue(); scenario_filename = root->getNode("scenario", true)->getStringValue();
if (scenario_filename != "") processScenario( scenario_filename ); if (scenario_filename != "") processScenario( scenario_filename );
initDone = true; initDone = true;
} }
@ -292,20 +292,19 @@ void FGAIManager::processScenario( string filename ) {
if (en) { if (en) {
if (en->m_type == "aircraft") {
if (en->m_class == "aircraft") {
createAircraft( en ); createAircraft( en );
} else if (en->m_class == "ship") { } else if (en->m_type == "ship") {
createShip( en ); createShip( en );
} else if (en->m_class == "storm") { } else if (en->m_type == "storm") {
createStorm( en ); createStorm( en );
} else if (en->m_class == "thermal") { } else if (en->m_type == "thermal") {
createThermal( en ); createThermal( en );
} else if (en->m_class == "ballistic") { } else if (en->m_type == "ballistic") {
createBallistic( en ); createBallistic( en );
} }
} }

View file

@ -54,9 +54,9 @@ FGAIScenario::FGAIScenario(string filename)
SGPropertyNode * node = root.getNode("scenario"); SGPropertyNode * node = root.getNode("scenario");
for (i = 0; i < node->nChildren(); i++) { for (i = 0; i < node->nChildren(); i++) {
//cout << "Reading entry " << i << endl; //cout << "Reading entry " << i << endl;
FGAIModelEntity* en = new FGAIModelEntity;
entries.push_back( en );
SGPropertyNode * entry_node = node->getChild(i); SGPropertyNode * entry_node = node->getChild(i);
FGAIModelEntity* en = new FGAIModelEntity;
en->callsign = entry_node->getStringValue("callsign", "none"); en->callsign = entry_node->getStringValue("callsign", "none");
en->m_type = entry_node->getStringValue("type", "aircraft"); en->m_type = entry_node->getStringValue("type", "aircraft");
en->m_class = entry_node->getStringValue("class", "jet_transport"); en->m_class = entry_node->getStringValue("class", "jet_transport");
@ -87,6 +87,7 @@ FGAIScenario::FGAIScenario(string filename)
if (en->flightplan != ""){ if (en->flightplan != ""){
en->fp = new FGAIFlightPlan( en->flightplan ); en->fp = new FGAIFlightPlan( en->flightplan );
} }
entries.push_back( en );
} }
entry_iterator = entries.begin(); entry_iterator = entries.begin();