1
0
Fork 0

Bugfix - don't exclude seaports or heliports when looking up by ICAO.

This commit is contained in:
jmt 2009-10-28 08:27:19 +00:00 committed by Tim Moore
parent 53b16caec0
commit 6593d6c065
2 changed files with 13 additions and 2 deletions

View file

@ -290,7 +290,7 @@ bool FGAirport::HardSurfaceFilter::passAirport(FGAirport* aApt) const
FGAirport* FGAirport::findByIdent(const std::string& aIdent)
{
FGPositionedRef r;
AirportFilter filter;
PortsFilter filter;
r = FGPositioned::findNextWithPartialId(r, aIdent, &filter);
if (!r) {
return NULL; // we don't warn here, let the caller do that
@ -301,7 +301,7 @@ FGAirport* FGAirport::findByIdent(const std::string& aIdent)
FGAirport* FGAirport::getByIdent(const std::string& aIdent)
{
FGPositionedRef r;
AirportFilter filter;
PortsFilter filter;
r = FGPositioned::findNextWithPartialId(r, aIdent, &filter);
if (!r) {
throw sg_range_exception("No such airport with ident: " + aIdent);

View file

@ -121,6 +121,17 @@ public:
}
};
/**
* Filter which passes heliports and seaports in addition to airports
*/
class PortsFilter : public AirportFilter
{
public:
virtual Type maxType() const {
return SEAPORT;
}
};
class HardSurfaceFilter : public AirportFilter
{
public: