1
0
Fork 0

Fred found some iterated related problems. With a bit of luck this solves the segmentation fault problem.

This commit is contained in:
ehofman 2004-05-19 08:01:02 +00:00
parent 009fa7371d
commit eb0b1492a2

View file

@ -147,9 +147,14 @@ void FGAIManager::update(double dt) {
if ((*ai_list_itr)->getDie()) {
freeID((*ai_list_itr)->getID());
delete (*ai_list_itr);
ai_list.erase(ai_list_itr);
--ai_list_itr;
--numObjects;
if ( ai_list_itr == ai_list.begin() ) {
ai_list.erase(ai_list_itr);
ai_list_itr = ai_list.begin();
continue;
} else {
ai_list.erase(ai_list_itr--);
}
} else {
fetchUserState();
if ((*ai_list_itr)->isa(FGAIBase::otThermal)) {