summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2015-08-30 00:07:22 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-29 20:06:53 -0700
commit4a9433864e6b8bb83746f64b6cf54c7be60cc23c (patch)
tree8f7693bf87d691365a90d4bcf20eb12ccbf9cb39 /planner.c
parente2178c0e55b327b0735006ae61fafc37b4bc2503 (diff)
downloadsubsurface-4a9433864e6b8bb83746f64b6cf54c7be60cc23c.tar.gz
VPM-B: Don't break the ceiling due to ongassing on ascent
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/planner.c b/planner.c
index 95052a9a7..a0231a3ae 100644
--- a/planner.c
+++ b/planner.c
@@ -876,11 +876,11 @@ bool trial_ascent(int trial_depth, int stoplevel, int avg_depth, int bottom_time
bool clear_to_ascend = true;
char *trial_cache = NULL;
- // For VPM-B it is not relevant if we would violate a ceiling during ascent to the next stop but
- // if the next stop is below the ceiling at the start of the ascent (thus the offgasing during
- // the ascent is ignored.
- if (prefs.deco_mode == VPMB)
- return (deco_allowed_depth(tissue_tolerance, surface_pressure, &displayed_dive, 1) <= stoplevel);
+ // For consistency with other VPM-B implementations, we should not start the ascent while the ceiling is
+ // deeper than the next stop (thus the offgasing during the ascent is ignored).
+ // However, we still need to make sure we don't break the ceiling due to on-gassing during ascent.
+ if (prefs.deco_mode == VPMB && (deco_allowed_depth(tissue_tolerance, surface_pressure, &displayed_dive, 1) > stoplevel))
+ return false;
cache_deco_state(tissue_tolerance, &trial_cache);
while (trial_depth > stoplevel) {