Bugfix - don't exclude seaports or heliports when looking up by ICAO.
This commit is contained in:
parent
53b16caec0
commit
6593d6c065
2 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue