1
0
Fork 0

src/Instrumentation/tcas.cxx: fixed handling of Swift craft.

Altitude of Swift craft is not in transponder information.
This commit is contained in:
Tobias Dammers 2021-11-09 21:41:22 +00:00 committed by Julian Smith
parent ec1a53d428
commit 5fabf44e51

View file

@ -591,7 +591,16 @@ static bool checkTransponderLocal(const SGPropertyNode* pModel, float velocityKt
// For MP aircraft (name='multiplayer') that are being ignored. // For MP aircraft (name='multiplayer') that are being ignored.
return false; return false;
} }
if (pModel->getNameString() == "aircraft") if (pModel->getNameString() == "swift")
{
/* Transponder info is in ./swift/transponder/ but altitude needs to
come from ./position/altitude-ft. */
bool xpdr_on = pModel->getBoolValue("swift/transponder/c-mode", false);
if (!xpdr_on) return false;
o_altFt = pModel->getDoubleValue("position/altitude-ft");
return true;
}
else if (pModel->getNameString() == "aircraft")
{ {
/* assume all non-MP and non-Swift (i.e. AI) aircraft have their transponder switched off while taxiing/parking /* assume all non-MP and non-Swift (i.e. AI) aircraft have their transponder switched off while taxiing/parking
* (at low speed) */ * (at low speed) */