]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/Schedule.cxx
don't destroy iterated map entries; delete _menubar; restore closed
[flightgear.git] / src / Traffic / Schedule.cxx
index 2bb86393e3c9c60db0308f481b574d05455bf65b..6dfe218da9e1fa47ad50dab8f214365e65b3fbeb 100644 (file)
@@ -367,7 +367,8 @@ bool FGAISchedule::update(time_t now)
              
              // Fixme: A non-existent model path results in an
              // abort, due to an unhandled exeption, in fg main loop.
-             AIManagerRef = aimgr->createAircraft( &entity, this);
+              FGAIBase *aircraft = (FGAIBase*)aimgr->createAircraft( &entity, this);
+             AIManagerRef = aircraft->getID();
              //cerr << "Class: " << m_class << ". acType: " << acType << ". Airline: " << airline << ". Speed = " << speed << ". From " << dep->getId() << " to " << arr->getId() << ". Time Fraction = " << (remainingTimeEnroute/(double) totalTimeEnroute) << endl;
              //cerr << "Latitude : " << lat << ". Longitude : " << lon << endl;
              //cerr << "Dep      : " << dep->getLatitude()<< ", "<< dep->getLongitude() << endl;
@@ -391,6 +392,15 @@ bool FGAISchedule::update(time_t now)
          return true;
        } 
     }
+  //cerr << "Traffic schedule got to beyond last clause" << endl;
+    // EMH: prevent a warning, should this be 'true' instead?
+    // DT: YES. Originally, this code couldn't be reached, but
+    // when the "if(!(AIManagerManager))" clause is false we
+    // fall through right to the end. This is a valid flow.
+    // the actual value is pretty innocent, only it triggers
+    // warning in TrafficManager::update().
+    // (which was added as a sanity check for myself in the first place. :-)
+    return true;
 }
 
 
@@ -444,7 +454,7 @@ void FGAISchedule::setClosestDistanceToUser()
 
   FGAirport *dep;
   
-#ifdef __CYGWIN__
+#if defined( __CYGWIN__) || defined( __MINGW32__)
   #define HUGE HUGE_VAL
 #endif
   distanceToUser = HUGE;