From 641c0d252b8f4d303dfed3359004cab46853d6f7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 5 Jan 2013 10:06:14 -0800 Subject: 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 --- deco.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'deco.c') diff --git a/deco.c b/deco.c index 9e286ec05..05adba555 100644 --- a/deco.c +++ b/deco.c @@ -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)); } -- cgit v1.2.3-70-g09d2