1
0
Fork 0

Rename {ai}/controls/flight/longitude-mode

Assuming this should have been ‘vertical-mode’ all along, since the
corresponding other mode property is called ‘lateral-mode’. Make an
alias to the old name to keep existing scripts working.
This commit is contained in:
James Turner 2019-02-03 13:38:22 +00:00
parent e23f0bc059
commit 1e0e7f7ffa
2 changed files with 10 additions and 3 deletions

View file

@ -1041,7 +1041,7 @@ void FGAIAircraft::updatePrimaryTargetValues(double dt, bool& flightplanActive,
}
string lon_mode
= props->getStringValue("controls/flight/longitude-mode");
= props->getStringValue("controls/flight/vertical-mode");
if ( lon_mode == "alt" ) {
double alt = props->getDoubleValue("controls/flight/target-alt" );
ClimbTo( alt );

View file

@ -239,7 +239,8 @@ void FGAIBase::readFromScenario(SGPropertyNode* scFileNode)
setLongitude(scFileNode->getDoubleValue("longitude", 0.0));
setLatitude(scFileNode->getDoubleValue("latitude", 0.0));
setBank(scFileNode->getDoubleValue("roll", 0.0));
setPitch(scFileNode->getDoubleValue("pitch", 0.0));
SGPropertyNode* submodels = scFileNode->getChild("submodels");
if (submodels) {
@ -707,7 +708,13 @@ void FGAIBase::bind() {
props->setDoubleValue("controls/flight/target-hdg", hdg);
props->setDoubleValue("controls/flight/target-roll", roll);
props->setStringValue("controls/flight/longitude-mode", "alt");
props->setStringValue("controls/flight/vertical-mode", "alt");
// The property above was incorrectly labelled 'longitude-mode' up until
// FG 2018.4, so create an alias in case anyone is relying on the old name
auto node = props->getNode("controls/flight/longitude-mode", true);
node->alias(props->getNode("controls/flight/vertical-mode"));
props->setDoubleValue("controls/flight/target-alt", altitude_ft);
props->setDoubleValue("controls/flight/target-pitch", pitch);