From 5fabf44e51c10faf4caaeef7aeece3c09359a39c Mon Sep 17 00:00:00 2001 From: Tobias Dammers Date: Tue, 9 Nov 2021 21:41:22 +0000 Subject: [PATCH] src/Instrumentation/tcas.cxx: fixed handling of Swift craft. Altitude of Swift craft is not in transponder information. --- src/Instrumentation/tcas.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/tcas.cxx b/src/Instrumentation/tcas.cxx index 3fdd45ced..7006011eb 100644 --- a/src/Instrumentation/tcas.cxx +++ b/src/Instrumentation/tcas.cxx @@ -591,7 +591,16 @@ static bool checkTransponderLocal(const SGPropertyNode* pModel, float velocityKt // For MP aircraft (name='multiplayer') that are being ignored. 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 * (at low speed) */