diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index e92b08fbd..486ad5fbc 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -197,14 +197,14 @@ FGAirport* FGAirportList::search(double lon_deg, double lat_deg) // search for the airport nearest the specified position and // passing the filter FGAirport* FGAirportList::search(double lon_deg, double lat_deg, - FGAirportSearchFilter& search) + FGAirportSearchFilter& filter) { double min_dist = 360.0; airport_list_iterator it = airports_array.begin(); airport_list_iterator end = airports_array.end(); airport_list_iterator closest = end; for (; it != end; ++it) { - if (!search.acceptable(*it)) + if (!filter.pass(*it)) continue; // crude manhatten distance based on lat/lon difference diff --git a/src/Airports/simple.hxx b/src/Airports/simple.hxx index d1930730a..6d9aceefe 100644 --- a/src/Airports/simple.hxx +++ b/src/Airports/simple.hxx @@ -109,7 +109,8 @@ private: class FGAirportSearchFilter { public: virtual ~FGAirportSearchFilter() {} - virtual bool acceptable(FGAirport*) { return true; } + // all airports pass the filter by default + virtual bool pass(FGAirport*) { return true; } }; diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index 5733ed67a..1446b982f 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -42,7 +42,7 @@ SG_USING_STD(sort); class metar_filter : public FGAirportSearchFilter { - virtual bool acceptable(FGAirport *a) { return a->getMetar(); } + virtual bool pass(FGAirport *a) { return a->getMetar(); } } metar_only; diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 92ec647df..16f910ce0 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -487,7 +487,7 @@ static naRef f_geodinfo(naContext c, naRef me, int argc, naRef* args) class airport_filter : public FGAirportSearchFilter { - virtual bool acceptable(FGAirport *a) { return a->isAirport(); } + virtual bool pass(FGAirport *a) { return a->isAirport(); } } airport; // Returns airport data for given airport id ("KSFO"), or for the airport