From 70a9c280f46998d32f273a5324042cb9fa235614 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Sat, 7 Dec 2013 16:25:39 +0100 Subject: Bugfix first deco stop finder The previous code checked against the current depth to find the next deco stop, not the ceiling we actually should head for. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- planner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'planner.c') diff --git a/planner.c b/planner.c index eb813cacc..9e9ed4799 100644 --- a/planner.c +++ b/planner.c @@ -635,7 +635,7 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, b if (depth == 0 && ceiling == 0) /* we are done here */ goto done; for (stopidx = 0; stopidx < sizeof(decostoplevels) / sizeof(int); stopidx++) - if (decostoplevels[stopidx] >= depth) + if (decostoplevels[stopidx] >= ceiling) break; if (stopidx > 0) stopidx--; -- cgit v1.2.3-70-g09d2