summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2017-11-03 18:48:14 +1100
committerGravatar Robert C. Helling <helling@atdotde.de>2017-11-08 15:22:32 +0100
commit05b411360936f879ac1ea8b131d22fe073255f9d (patch)
treeb46c06aebb8026f589e4d0284fc58ee2ea527a44
parent8e1ea8cd144ee216dae1aca2d016118d83a0d8bb (diff)
downloadsubsurface-05b411360936f879ac1ea8b131d22fe073255f9d.tar.gz
VPMB: time_clear_ceiling is only valid after time_deep_ceiling
Some messed up logic was producing negative deco_time values for some no-deco dives. The CVA wouldn't converge and unrealistic VPMB ceilings were displayed in the profile. This fixes it. See #762 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
-rw-r--r--core/profile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/profile.c b/core/profile.c
index 631aaa8b8..a1d0c45f0 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -1036,7 +1036,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru
// Use the point where the ceiling clears as the end of deco phase for CVA calculations
if (current_ceiling > 0)
time_clear_ceiling = 0;
- else if (time_clear_ceiling == 0)
+ else if (time_clear_ceiling == 0 && t1 > time_deep_ceiling)
time_clear_ceiling = t1;
}
}