From 8b5c5674b1aa7638ef0de2fd73f7780fd9121e86 Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Sun, 24 Sep 2017 17:29:56 +1000 Subject: [PATCH] VPM-B profile: initialize first_ceiling_pressure If we don't set first_ceiling_pressure at start of dive, a shallow ceiling can be shown when it shouldn't be. Fixes #584 Signed-off-by: Rick Walsh Signed-off-by: Robert C. Helling --- core/profile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/profile.c b/core/profile.c index 813e69fc2..07b0a96a2 100644 --- a/core/profile.c +++ b/core/profile.c @@ -966,6 +966,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru * Set maximum number of iterations to 10 just in case */ while ((abs(prev_deco_time - deco_time) >= 30) && (count_iteration < 10)) { int last_ndl_tts_calc_time = 0, first_ceiling = 0, current_ceiling, final_tts = 0 , time_clear_ceiling = 0, time_deep_ceiling = 0; + deco_state->first_ceiling_pressure.mbar = depth_to_mbar(first_ceiling, dive); struct gasmix *gasmix = NULL; struct event *ev = NULL;