]> git.mxchange.org Git - flightgear.git/commitdiff
- don't abort just because of an unexpected "repeat period"! Complain and
authormfranz <mfranz>
Thu, 10 May 2007 14:28:17 +0000 (14:28 +0000)
committermfranz <mfranz>
Thu, 10 May 2007 14:28:17 +0000 (14:28 +0000)
  recover instead
- it was apparently planned to run the updated loop only every 1000th
  frame, but the counter isn't reset, so it runs every frame
- use SG_LOG instead of cerr
- don't add redundant slashes in SGPath::append()

src/Traffic/SchedFlight.cxx
src/Traffic/TrafficMgr.cxx

index a66915a1e0831069d2772ada688ab00c2560bef9..52661664d4924368d76da665792e43c9dc8d03a2 100644 (file)
@@ -127,8 +127,9 @@ FGScheduledFlight::FGScheduledFlight(const string& cs,
     }
   else
     {
-      cerr << "Unknown repeat period" << endl;
-      exit(1);
+      repeatPeriod = 365*24*60*60;
+      SG_LOG( SG_GENERAL, SG_ALERT, "Unknown repeat period in flight plan "
+                                    "of flight '" << cs << "': " << rep );
     }
 
   // What we still need to do is preprocess the departure and
index dd42d52f381a56f16bad648f6f37cb7015cda618..70e8af64491c3e94e7654255e19846fe426b8b5c 100644 (file)
@@ -123,10 +123,10 @@ void FGTrafficManager::init()
    * until we have some AI models with traffic in the base package
    */ 
   SGPath path = aircraftDir;
-  path.append("/Traffic/fgtraffic.xml");
+  path.append("Traffic/fgtraffic.xml");
   readXML(path.str(),*this);
 
-  aircraftDir.append("AI/Aircraft/");
+  aircraftDir.append("AI/Aircraft");
   if (aircraftDir.exists())
     {
       if((d = ulOpenDir(aircraftDir.c_str())) == NULL)
@@ -166,7 +166,7 @@ void FGTrafficManager::init()
   //cerr << "Done initializing schedules" << endl;
 }
 
-void FGTrafficManager::update(double something)
+void FGTrafficManager::update(double /*dt*/)
 {
   //SG_LOG( SG_GENERAL, SG_INFO, "Running TrafficManager::Update() ");
   if (runCount < 1000)
@@ -174,6 +174,7 @@ void FGTrafficManager::update(double something)
       runCount++;
       return;
     }
+  runCount = 0;
   time_t now = time(NULL) + fgGetLong("/sim/time/warp");
   if (scheduledAircraft.size() == 0) {
     //SG_LOG( SG_GENERAL, SG_INFO, "Returned Running TrafficManager::Update() ");
@@ -188,7 +189,7 @@ void FGTrafficManager::update(double something)
     {
       // after proper initialization, we shouldnt get here.
       // But let's make sure
-      cerr << "Failed to update aircraft schedule in traffic manager" << endl;
+      SG_LOG( SG_GENERAL, SG_ALERT, "Failed to update aircraft schedule in traffic manager");
     }
   currAircraft++;
   //SG_LOG( SG_GENERAL, SG_INFO, "Done Running TrafficManager::Update() ");