1
0
Fork 0

Fix for a crash reported by Maik Justus.

This commit is contained in:
durk 2006-11-14 20:08:50 +00:00
parent 06dc1d6afa
commit e389bed31f
2 changed files with 6 additions and 5 deletions

View file

@ -165,14 +165,14 @@ FGAIBase::load3DModel(const string& fg_root,
// SetModel as in ATC/AIEntity.cxx // SetModel as in ATC/AIEntity.cxx
osg::Group* personality_branch = new osg::Group; osg::Group* personality_branch = new osg::Group;
model = manager->getModel(path); //model = manager->getModel(path);
if (!(model)) { //if (!(model)) {
model = sgLoad3DModel(fg_root, model = sgLoad3DModel(fg_root,
path, path,
prop_root, prop_root,
sim_time_sec); sim_time_sec);
manager->setModel(path, model.get()); // manager->setModel(path, model.get());
} //}
personality_branch->addChild( model.get() ); personality_branch->addChild( model.get() );
return personality_branch; return personality_branch;

View file

@ -765,6 +765,7 @@ void FGGroundNetwork::checkSpeedAdjustment(int id, double lat,
SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkSpeedAdjustment"); SG_LOG(SG_GENERAL, SG_ALERT, "AI error: Trying to access non-existing aircraft in FGGroundNetwork::checkSpeedAdjustment");
} }
current = i; current = i;
closest = current;
previousInstruction = current->getSpeedAdjustment(); previousInstruction = current->getSpeedAdjustment();
double mindist = HUGE; double mindist = HUGE;
if (activeTraffic.size()) if (activeTraffic.size())
@ -774,7 +775,7 @@ void FGGroundNetwork::checkSpeedAdjustment(int id, double lat,
lat, lat,
alt); alt);
//TrafficVector iterator closest; //TrafficVector iterator closest;
closest = current; //closest = current;
for (TrafficVectorIterator i = activeTraffic.begin(); for (TrafficVectorIterator i = activeTraffic.begin();
i != activeTraffic.end(); i++) i != activeTraffic.end(); i++)
{ {