]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIMgr.cxx
Catch sound exceptions at the earliest, report problem has an alert, and continue...
[flightgear.git] / src / ATC / AIMgr.cxx
index 4fdc5eec235366fd6ccf4d81657bacb529629d75..2263f475934a1cddadcf6c7749ab19d249f6214c 100644 (file)
@@ -48,7 +48,7 @@ SG_USING_STD(cout);
 FGAIMgr::FGAIMgr() {
        ATC = globals->get_ATC_mgr();
        initDone = false;
-       ai_callsigns_used["CFGFS"] = 1; // so we don't inadvertently use this
+       ai_callsigns_used["GFS"] = 1;   // so we don't inadvertently use this
        // TODO - use the proper user callsign when it becomes user settable.
        removalList.clear();
        activated.clear();
@@ -56,8 +56,6 @@ FGAIMgr::FGAIMgr() {
 }
 
 FGAIMgr::~FGAIMgr() {
-        ssgDeRefDelete(_defaultModel);
-       if(_havePiperModel) ssgDeRefDelete(_piperModel);
 }
 
 void FGAIMgr::init() {
@@ -105,10 +103,6 @@ void FGAIMgr::init() {
                _havePiperModel = false;
        }
 
-       // We need to keep one ref of the models open to stop ssg deleting them behind our back!
-       _defaultModel->ref();
-       if(_havePiperModel) _piperModel->ref();
-
        // go through the $FG_ROOT/ATC directory and find all *.taxi files
        SGPath path(globals->get_fg_root());
        path.append("ATC/");
@@ -381,7 +375,10 @@ void FGAIMgr::GenerateSimpleAirportTraffic(const string& ident, double min_dist)
        double d = dclGetHorizontalSeparation(userpos, aptpos); // in meters
        
        int lev = fgGetInt("/sim/ai-traffic/level");
-       if(lev < 1 || lev > 3) lev = 2;
+       if(lev < 1)
+               return;
+       if (lev > 3)
+               lev = 3;
        if(visibility < 6000) lev = 1;
        //cout << "level = " << lev << '\n';