FGAIManager::~FGAIManager() {
ai_list_itr = ai_list.begin();
while(ai_list_itr != ai_list.end()) {
+ (*ai_list_itr)->unbind();
delete (*ai_list_itr);
++ai_list_itr;
}
if ((*ai_list_itr)->getDie()) {
--numObjects[(*ai_list_itr)->getType()];
--numObjects[0];
+ (*ai_list_itr)->unbind();
delete (*ai_list_itr);
if ( ai_list_itr == ai_list.begin() ) {
ai_list.erase(ai_list_itr);
if ((*ai_list_itr)->getID() == ID) {
--numObjects[0];
--numObjects[(*ai_list_itr)->getType()];
+ (*ai_list_itr)->unbind();
delete (*ai_list_itr);
ai_list.erase(ai_list_itr);
}
-void FGAIManager::processScenario( string filename ) {
+void FGAIManager::processScenario( string &filename ) {
FGAIScenario* s = new FGAIScenario( filename );
for (int i=0;i<s->nEntries();i++) {
FGAIModelEntity* en = s->getNextEntry();
if (en) {
-
- if (en->m_type == "aircraft") {
+ if ( !strcmp(en->m_type, "aircraft")) {
createAircraft( en );
- } else if (en->m_type == "ship") {
+ } else if ( !strcmp(en->m_type, "ship")) {
createShip( en );
- } else if (en->m_type == "storm") {
+ } else if ( !strcmp(en->m_type, "thunderstorm")) {
createStorm( en );
- } else if (en->m_type == "thermal") {
+ } else if ( !strcmp(en->m_type, "thermal")) {
createThermal( en );
- } else if (en->m_type == "ballistic") {
+ } else if ( !strcmp(en->m_type, "ballistic")) {
createBallistic( en );
}
}