From 05b411360936f879ac1ea8b131d22fe073255f9d Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Fri, 3 Nov 2017 18:48:14 +1100 Subject: 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 --- core/profile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') 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; } } -- cgit v1.2.3-70-g09d2