Controls: ensure engine index is valid
Some spacecraft send out-of-range engine numbers from the JSBsim side. Should probably be fixed in JSBsim itself but let’s check here to keep compat with existing FDMs.
This commit is contained in:
parent
bc4a2b3ab7
commit
a702fd7b27
1 changed files with 1 additions and 1 deletions
|
@ -1831,7 +1831,7 @@ void FGControls::fireEngineValueChanged(int index, simgear::PropertyList& props)
|
||||||
std::for_each(props.begin(), props.end(), [](const SGPropertyNode_ptr &p) {
|
std::for_each(props.begin(), props.end(), [](const SGPropertyNode_ptr &p) {
|
||||||
p->fireValueChanged();
|
p->fireValueChanged();
|
||||||
});
|
});
|
||||||
} else {
|
} else if ((index >= 0) && (index < MAX_ENGINES)) {
|
||||||
props.at(index)->fireValueChanged();
|
props.at(index)->fireValueChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue