From 09bbd846da2289a49e566c6b2742b62d9d7bdc79 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Fri, 7 May 2021 10:05:43 +0200 Subject: The planner should not always ascent from the depth of the last manually entered waypoint but consider the possibility that it should first top where we are before the next stop depth has cleared. Reported-by: David Carron Signed-off-by: Robert C. Helling --- core/planner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/planner.c b/core/planner.c index be257a0a0..98c75df1e 100644 --- a/core/planner.c +++ b/core/planner.c @@ -757,7 +757,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i /* Find the first potential decostopdepth above current depth */ for (stopidx = 0; stopidx < decostoplevelcount; stopidx++) - if (*(decostoplevels + stopidx) >= depth) + if (decostoplevels[stopidx] > depth) break; if (stopidx > 0) stopidx--; -- cgit v1.2.3-70-g09d2