Fix bug in smooth ceiling mode

The ceiling calculations for the gradient factors still had a 3m increment
hardcoded. This is now also conditional on the smooth parameter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-01-05 10:06:14 -08:00
parent 635f190302
commit 641c0d252b

5
deco.c
View file

@ -247,7 +247,10 @@ unsigned int deco_allowed_depth(double tissues_tolerance, double surface_pressur
below_gradient_limit = (new_gradient_factor < actual_gradient_limit(&mydata));
while(!below_gradient_limit)
{
mydata.pressure += PRESSURE_CHANGE_3M;
if (!smooth)
mydata.pressure += PRESSURE_CHANGE_3M;
else
mydata.pressure += PRESSURE_CHANGE_3M / 30; /* 4in / 10cm instead */
new_gradient_factor = gradient_factor_calculation(&mydata);
below_gradient_limit = (new_gradient_factor < actual_gradient_limit(&mydata));
}