[PATCH 2/7] Bugfix first deco stop finder

Anton Lundin glance at acc.umu.se
Sat Dec 7 07:25:39 UTC 2013


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 at acc.umu.se>
---
 planner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/planner.c b/planner.c
index eb813ca..9e9ed47 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--;
-- 
1.8.3.2



More information about the subsurface mailing list