From e389bed31f089ad7db1bb285e5bddf00febe4bc8 Mon Sep 17 00:00:00 2001 From: durk Date: Tue, 14 Nov 2006 20:08:50 +0000 Subject: [PATCH] Fix for a crash reported by Maik Justus. --- src/AIModel/AIBase.cxx | 8 ++++---- src/Airports/groundnetwork.cxx | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index b50f93983..de52894b0 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -165,14 +165,14 @@ FGAIBase::load3DModel(const string& fg_root, // SetModel as in ATC/AIEntity.cxx osg::Group* personality_branch = new osg::Group; - model = manager->getModel(path); - if (!(model)) { + //model = manager->getModel(path); + //if (!(model)) { model = sgLoad3DModel(fg_root, path, prop_root, sim_time_sec); - manager->setModel(path, model.get()); - } + // manager->setModel(path, model.get()); + //} personality_branch->addChild( model.get() ); return personality_branch; diff --git a/src/Airports/groundnetwork.cxx b/src/Airports/groundnetwork.cxx index 2d17d9487..711efa50b 100644 --- a/src/Airports/groundnetwork.cxx +++ b/src/Airports/groundnetwork.cxx @@ -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"); } current = i; + closest = current; previousInstruction = current->getSpeedAdjustment(); double mindist = HUGE; if (activeTraffic.size()) @@ -774,7 +775,7 @@ void FGGroundNetwork::checkSpeedAdjustment(int id, double lat, lat, alt); //TrafficVector iterator closest; - closest = current; + //closest = current; for (TrafficVectorIterator i = activeTraffic.begin(); i != activeTraffic.end(); i++) {