From 22c05292808f9a85522cc738ef3cbf53c1cd040c Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 13 Jun 2004 18:44:21 +0000 Subject: [PATCH] Work around a potential never ending loop problem. A proper fix will be in the next JSBSim update. --- src/FDM/JSBSim/filtersjb/FGKinemat.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/FDM/JSBSim/filtersjb/FGKinemat.cpp b/src/FDM/JSBSim/filtersjb/FGKinemat.cpp index a12a47113..feb5e5e8a 100644 --- a/src/FDM/JSBSim/filtersjb/FGKinemat.cpp +++ b/src/FDM/JSBSim/filtersjb/FGKinemat.cpp @@ -154,6 +154,8 @@ bool FGKinemat::Run(void ) if (Detents[ind] < ThisInput) ThisInput = Detents[ind]; // Compute the time to reach the value in ThisInput double ThisDt = fabs((ThisInput-Output)/Rate); + if (ThisDt == 0.0) + break; // and clip to the timestep size if (dt < ThisDt) ThisDt = dt; dt -= ThisDt;