mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 06:25:33 +08:00
Fixes 2,4,6 refs #287
https://dev.vatsim-germany.org/issues/287#note-14
This commit is contained in:
@@ -62,7 +62,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
/*
|
||||
* airports within range
|
||||
* Airports within range
|
||||
*/
|
||||
CAirportList CAirportList::findWithinRange(const BlackMisc::Geo::ICoordinateGeodetic &coordinate, const PhysicalQuantities::CLength &range) const
|
||||
{
|
||||
@@ -73,7 +73,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
/*
|
||||
* Distances to own plane
|
||||
* Distances, bearing to own plane
|
||||
*/
|
||||
void CAirportList::calculcateDistanceAndBearingToPlane(const Geo::CCoordinateGeodetic &position)
|
||||
{
|
||||
@@ -83,19 +83,15 @@ namespace BlackMisc
|
||||
});
|
||||
}
|
||||
|
||||
void CAirportList::removeIfOutsideRange(const Geo::CCoordinateGeodetic &position, const CLength &maxDistance, bool updateDistance)
|
||||
/*
|
||||
* Remove outside range
|
||||
*/
|
||||
void CAirportList::removeIfOutsideRange(const Geo::CCoordinateGeodetic &position, const CLength &maxDistance, bool updateValues)
|
||||
{
|
||||
CLength d;
|
||||
for (CAirportList::iterator i = begin(); i != end();)
|
||||
{
|
||||
if (updateDistance)
|
||||
{
|
||||
d = i->calculcateDistanceAndBearingToPlane(position);
|
||||
}
|
||||
else
|
||||
{
|
||||
d = i->greatCircleDistance(position);
|
||||
}
|
||||
d = i->calculcateDistanceAndBearingToPlane(position, updateValues);
|
||||
if (maxDistance < d)
|
||||
{
|
||||
i = this->erase(i);
|
||||
|
||||
Reference in New Issue
Block a user