1
0
Fork 0

Olaf Flebbe:

The prototype of update_metar_properties does not match overridden func.
trafficmgr: iterators below begin() and after end().
tower.cxx : iterator incrementing beyond end().
This commit is contained in:
ehofman 2005-12-19 13:03:19 +00:00
parent 2d4ffc0dce
commit 9090fb5bf4
4 changed files with 6 additions and 3 deletions

View file

@ -1109,6 +1109,8 @@ void FGTower::CheckCircuitList(double dt) {
circuitListItr = circuitList.erase(circuitListItr);
if(circuitListItr == circuitList.end() ) {
circuitListItr = circuitList.begin();
// avoid increment of circuitListItr (would increment to second element, or crash if no element left)
return;
}
}
++circuitListItr;

View file

@ -263,7 +263,7 @@ void FGClouds::buildMETAR(void) {
// copy from FGMetarEnvironmentCtrl until better
void
FGClouds::update_metar_properties( FGMetar *m )
FGClouds::update_metar_properties( const FGMetar *m )
{
int i;
double d;

View file

@ -51,7 +51,7 @@ private:
void setLayer( int iLayer, float alt_m, const string& coverage, const string& layer_type );
void update_metar_properties( FGMetar *m );
void update_metar_properties( const FGMetar *m );
void FGClouds::update_env_config ();

View file

@ -85,7 +85,6 @@ void FGTrafficManager::init()
{
currAircraft=scheduledAircraft.erase(currAircraft);
//cerr << "Erasing " << currAircraft->getRegistration() << endl;
currAircraft--;
}
else
{
@ -102,6 +101,8 @@ void FGTrafficManager::init()
void FGTrafficManager::update(double something)
{
time_t now = time(NULL) + fgGetLong("/sim/time/warp");
if (scheduledAircraft.size() == 0)
return;
if(currAircraft == scheduledAircraft.end())
{
//cerr << "resetting schedule " << endl;