From c89e5203a55c7ce4adc73c0fe16ca7d8ffc5afc6 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 23 Mar 2005 18:54:58 +0000 Subject: [PATCH] Insert a sanity hack from Melchior that apparently prevents a NaN from popping up and crashing when the B-29 model is in use. This isn't the right solution; we should fine the NaN condition. But it's harmless and allows development with the B-29 to continue. --- src/FDM/YASim/PropEngine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/FDM/YASim/PropEngine.cpp b/src/FDM/YASim/PropEngine.cpp index 866ef8165..ca5e51bf7 100644 --- a/src/FDM/YASim/PropEngine.cpp +++ b/src/FDM/YASim/PropEngine.cpp @@ -176,6 +176,8 @@ void PropEngine::integrate(float dt) _eng->setFuelState(_fuel); _prop->calc(_rho, speed, _omega * _gearRatio, &thrust, &propTorque); + if(_omega == 0.0) + _omega = 0.001; // hack to get around reports of NaNs somewhere... propTorque *= _gearRatio; _eng->calc(_pressure, _temp, _omega); _eng->integrate(dt); -- 2.39.5