Remove last hard-coded default airport ID
Neither Torsten nor I can recall why we continued to hard-code this, so make it dynamic for now. When we remember why we hard-code it, we can add a BigComment from future-James to future-future-James about why not to do this again :)
This commit is contained in:
parent
4ed410dc09
commit
88a78dd314
1 changed files with 4 additions and 4 deletions
|
@ -663,9 +663,8 @@ bool initPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !set_pos ) {
|
if ( !set_pos ) {
|
||||||
// No lon/lat specified, no airport specified, use the default airport
|
const std::string defaultAirportId = fgGetString("/sim/presets/airport-id");
|
||||||
// TODO: don't hardcode this. Really.
|
const FGAirport* airport = fgFindAirportID(defaultAirportId);
|
||||||
const FGAirport* airport = fgFindAirportID("PHNL");
|
|
||||||
if( airport ) {
|
if( airport ) {
|
||||||
const SGGeod & airportGeod = airport->geod();
|
const SGGeod & airportGeod = airport->geod();
|
||||||
fgSetDouble("/sim/presets/longitude-deg", airportGeod.getLongitudeDeg());
|
fgSetDouble("/sim/presets/longitude-deg", airportGeod.getLongitudeDeg());
|
||||||
|
@ -675,7 +674,8 @@ bool initPosition()
|
||||||
// Let's hope KSFO still exists somehow
|
// Let's hope KSFO still exists somehow
|
||||||
fgSetDouble("/sim/presets/longitude-deg", -122.374843);
|
fgSetDouble("/sim/presets/longitude-deg", -122.374843);
|
||||||
fgSetDouble("/sim/presets/latitude-deg", 37.619002);
|
fgSetDouble("/sim/presets/latitude-deg", 37.619002);
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "Sorry, the default airport seems to be unknown.");
|
SG_LOG(SG_GENERAL, SG_ALERT, "Sorry, the default airport ('" << defaultAirportId
|
||||||
|
<< "') seems to be unknown.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue