FGNavList::TypeFilter filter(type);
const nav_list_type navlist = FGNavList::findByIdentAndFreq( id.c_str(), freq, &filter );
- if (navlist.size() == 0 ) {
+ if (navlist.empty()) {
SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate NAV = "
<< id << ":" << freq );
return false;
}
fgSetBool("/sim/position-finalized", false);
+
+// Initialize the longitude, latitude and altitude to the initial position
+ fgSetDouble("/position/altitude-ft", fgGetDouble("/sim/presets/altitude-ft"));
+ fgSetDouble("/position/longitude-deg", fgGetDouble("/sim/presets/longitude-deg"));
+ fgSetDouble("/position/latitude-deg", fgGetDouble("/sim/presets/latitude-deg"));
return true;
}