summaryrefslogtreecommitdiffstats
path: root/deco.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-05 10:06:14 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-05 10:06:14 -0800
commit641c0d252b8f4d303dfed3359004cab46853d6f7 (patch)
tree124d5275812e9e41db590cfee42b7b1b049fd55f /deco.c
parent635f190302cc3b00fb4daedd4fced940fcee7349 (diff)
downloadsubsurface-641c0d252b8f4d303dfed3359004cab46853d6f7.tar.gz
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>
Diffstat (limited to 'deco.c')
-rw-r--r--deco.c5
1 files changed, 4 insertions, 1 deletions
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));
}