TCAS: do not process invalid AI models
This commit is contained in:
parent
6077ef8cdd
commit
5f994c94b9
1 changed files with 4 additions and 2 deletions
|
@ -547,7 +547,7 @@ TCAS::ThreatDetector::init(void)
|
||||||
nodeHeading = fgGetNode("/orientation/heading-deg", true);
|
nodeHeading = fgGetNode("/orientation/heading-deg", true);
|
||||||
nodeVelocity = fgGetNode("/velocities/airspeed-kt", true);
|
nodeVelocity = fgGetNode("/velocities/airspeed-kt", true);
|
||||||
nodeVerticalFps = fgGetNode("/velocities/vertical-speed-fps", true);
|
nodeVerticalFps = fgGetNode("/velocities/vertical-speed-fps", true);
|
||||||
|
|
||||||
tcas->advisoryGenerator.init(&self,¤tThreat);
|
tcas->advisoryGenerator.init(&self,¤tThreat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,7 +620,9 @@ TCAS::ThreatDetector::checkThreat(int mode, const SGPropertyNode* pModel)
|
||||||
#ifdef FEATURE_TCAS_DEBUG_THREAT_DETECTOR
|
#ifdef FEATURE_TCAS_DEBUG_THREAT_DETECTOR
|
||||||
checkCount++;
|
checkCount++;
|
||||||
#endif
|
#endif
|
||||||
|
if (!pModel->getBoolValue("valid"))
|
||||||
|
return ThreatInvisible;
|
||||||
|
|
||||||
float velocityKt = pModel->getDoubleValue("velocities/true-airspeed-kt");
|
float velocityKt = pModel->getDoubleValue("velocities/true-airspeed-kt");
|
||||||
|
|
||||||
if (!checkTransponder(pModel, velocityKt))
|
if (!checkTransponder(pModel, velocityKt))
|
||||||
|
|
Loading…
Add table
Reference in a new issue