From 34236e3c84acd76ecb26a8abb4e10ccada4636ff Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Fri, 29 Dec 2017 11:50:20 +1100 Subject: [PATCH] Planner notes: don't omit deco stops with rapid ascent rates This fixes a bug where if the user entered very high ascent (or less commonly descent) rates such that the time to ascend (or descend) from one level to the next was less than 10s, that leg would be skipped in the dive plan notes. Reported-by: Alexander Maier Signed-off-by: Rick Walsh --- core/plannernotes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/plannernotes.c b/core/plannernotes.c index a2d4efa19..d5fedd4bc 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -162,7 +162,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d !gaschange_before && !gaschange_after) continue; - if (dp->time - lasttime < 10 && !(gaschange_after && dp->next && dp->depth.mm != dp->next->depth.mm)) + if ((dp->time - lasttime < 10 && lastdepth == dp->depth.mm) && !(gaschange_after && dp->next && dp->depth.mm != dp->next->depth.mm)) continue; /* Store pointer to last entered datapoint for minimum gas calculation */