Removed a potentially illegal cross-container iterator comparison that made
FlightGear crash on mircosoft visual c++ compilers, as reported by Maik Justus.
This commit is contained in:
parent
6ad85fbae9
commit
3bd32f75e4
2 changed files with 20 additions and 22 deletions
|
@ -765,7 +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;
|
||||
//closest = current;
|
||||
previousInstruction = current->getSpeedAdjustment();
|
||||
double mindist = HUGE;
|
||||
if (activeTraffic.size())
|
||||
|
@ -775,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++)
|
||||
{
|
||||
|
@ -804,25 +804,24 @@ void FGGroundNetwork::checkSpeedAdjustment(int id, double lat,
|
|||
for (TrafficVectorIterator i = towerController->getActiveTraffic().begin();
|
||||
i != towerController->getActiveTraffic().end(); i++)
|
||||
{
|
||||
if (i != current) {
|
||||
//SGWayPoint curr (lon,
|
||||
// lat,
|
||||
// alt);
|
||||
SGWayPoint other (i->getLongitude (),
|
||||
i->getLatitude (),
|
||||
i->getAltitude ());
|
||||
other.CourseAndDistance(curr, &course, &dist);
|
||||
bearing = fabs(heading-course);
|
||||
if (bearing > 180)
|
||||
bearing = 360-bearing;
|
||||
if ((dist < mindist) && (bearing < 60.0))
|
||||
{
|
||||
mindist = dist;
|
||||
closest = i;
|
||||
minbearing = bearing;
|
||||
otherReasonToSlowDown = true;
|
||||
}
|
||||
}
|
||||
//cerr << "Comparing " << current->getId() << " and " << i->getId() << endl;
|
||||
//SGWayPoint curr (lon,
|
||||
// lat,
|
||||
// alt);
|
||||
SGWayPoint other (i->getLongitude (),
|
||||
i->getLatitude (),
|
||||
i->getAltitude ());
|
||||
other.CourseAndDistance(curr, &course, &dist);
|
||||
bearing = fabs(heading-course);
|
||||
if (bearing > 180)
|
||||
bearing = 360-bearing;
|
||||
if ((dist < mindist) && (bearing < 60.0))
|
||||
{
|
||||
mindist = dist;
|
||||
closest = i;
|
||||
minbearing = bearing;
|
||||
otherReasonToSlowDown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Finally, check UserPosition
|
||||
|
|
|
@ -173,7 +173,6 @@ public:
|
|||
string getRunway() { return runway; };
|
||||
void setCallSign(string clsgn) { callsign = clsgn; };
|
||||
string getCallSign() { return callsign; };
|
||||
|
||||
};
|
||||
|
||||
typedef vector<FGTrafficRecord> TrafficVector;
|
||||
|
|
Loading…
Add table
Reference in a new issue