1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

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>
This commit is contained in:
Anton Lundin 2013-12-07 16:25:39 +01:00 committed by Dirk Hohndel
parent 4696354f4b
commit 70a9c280f4

View file

@ -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--;