Fix a startup issue Vic Mar reported
- accept invalid/missing airport IDs when starting ATC
This commit is contained in:
parent
9c467af6bf
commit
ff33aa038e
1 changed files with 5 additions and 1 deletions
|
@ -76,7 +76,8 @@ FGAirportDynamicsRef AirportDynamicsManager::dynamicsForICAO(const std::string &
|
||||||
|
|
||||||
FGAirportRef apt(FGAirport::findByIdent(icao));
|
FGAirportRef apt(FGAirport::findByIdent(icao));
|
||||||
if (!apt)
|
if (!apt)
|
||||||
throw sg_exception("dynamicsForICAO: Invalid ICAO:" + icao);
|
return FGAirportDynamicsRef();
|
||||||
|
|
||||||
FGAirportDynamicsRef d(new FGAirportDynamics(apt));
|
FGAirportDynamicsRef d(new FGAirportDynamics(apt));
|
||||||
|
|
||||||
XMLLoader::load(d.ptr());
|
XMLLoader::load(d.ptr());
|
||||||
|
@ -92,6 +93,9 @@ FGAirportDynamicsRef AirportDynamicsManager::dynamicsForICAO(const std::string &
|
||||||
|
|
||||||
FGAirportDynamicsRef AirportDynamicsManager::find(const std::string &icao)
|
FGAirportDynamicsRef AirportDynamicsManager::find(const std::string &icao)
|
||||||
{
|
{
|
||||||
|
if (icao.empty())
|
||||||
|
return FGAirportDynamicsRef();
|
||||||
|
|
||||||
AirportDynamicsManager* instance = static_cast<AirportDynamicsManager*>(globals->get_subsystem("airport-dynamics"));
|
AirportDynamicsManager* instance = static_cast<AirportDynamicsManager*>(globals->get_subsystem("airport-dynamics"));
|
||||||
if (!instance)
|
if (!instance)
|
||||||
return FGAirportDynamicsRef();
|
return FGAirportDynamicsRef();
|
||||||
|
|
Loading…
Add table
Reference in a new issue