From 5f994c94b9a96614bdd4b0a8e63b9b864faacd19 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Mon, 13 Nov 2017 22:54:48 +0100 Subject: [PATCH] TCAS: do not process invalid AI models --- src/Instrumentation/tcas.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Instrumentation/tcas.cxx b/src/Instrumentation/tcas.cxx index c06e3ffd0..6f9e1fb9c 100644 --- a/src/Instrumentation/tcas.cxx +++ b/src/Instrumentation/tcas.cxx @@ -547,7 +547,7 @@ TCAS::ThreatDetector::init(void) nodeHeading = fgGetNode("/orientation/heading-deg", true); nodeVelocity = fgGetNode("/velocities/airspeed-kt", true); nodeVerticalFps = fgGetNode("/velocities/vertical-speed-fps", true); - + tcas->advisoryGenerator.init(&self,¤tThreat); } @@ -620,7 +620,9 @@ TCAS::ThreatDetector::checkThreat(int mode, const SGPropertyNode* pModel) #ifdef FEATURE_TCAS_DEBUG_THREAT_DETECTOR checkCount++; #endif - + if (!pModel->getBoolValue("valid")) + return ThreatInvisible; + float velocityKt = pModel->getDoubleValue("velocities/true-airspeed-kt"); if (!checkTransponder(pModel, velocityKt))