summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-12-07 16:25:39 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-07 08:02:48 -0800
commit70a9c280f46998d32f273a5324042cb9fa235614 (patch)
tree4209da9fadfba71856651d77d40bda3a057dd782 /planner.c
parent4696354f4bcc34baba8f6fbfd1159ebe03366072 (diff)
downloadsubsurface-70a9c280f46998d32f273a5324042cb9fa235614.tar.gz
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 <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c2
1 files changed, 1 insertions, 1 deletions
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--;