1
0
Fork 0

Eliminate divide-by-zero error. AI should spin down gradually again.

This commit is contained in:
david 2003-07-22 02:05:50 +00:00
parent 4124ac31d7
commit 45b16ad0c9

View file

@ -55,7 +55,7 @@ VacuumSystem::update (double dt)
// simple regulator model that clamps smoothly to about 5 inhg // simple regulator model that clamps smoothly to about 5 inhg
// over a normal rpm range // over a normal rpm range
double max = 5.39 - 1.0 / ( rpm * 0.00111 ); double max = (rpm > 0 ? 5.39 - 1.0 / ( rpm * 0.00111 ) : 0);
if ( suction < 0.0 ) suction = 0.0; if ( suction < 0.0 ) suction = 0.0;
if ( suction > max ) suction = max; if ( suction > max ) suction = max;
} }