summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/planner.c b/planner.c
index 822d2e789..a707f7552 100644
--- a/planner.c
+++ b/planner.c
@@ -47,6 +47,14 @@ void dump_plan(struct diveplan *diveplan)
}
#endif
+void set_last_stop(gboolean last_stop_6m)
+{
+ if (last_stop_6m == TRUE)
+ decostoplevels[1] = 6000;
+ else
+ decostoplevels[1] = 3000;
+}
+
void get_gas_from_events(struct divecomputer *dc, int time, int *o2, int *he)
{
struct event *event = dc->events;
@@ -650,6 +658,12 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, c
record_dive(dive);
}
while (stopidx > 0) { /* this indicates that we aren't surfacing directly */
+ /* if we are in a double-step, eg, when 3m/10ft stop is disabled,
+ * just skip the first stop at that depth */
+ if (stoplevels[stopidx] == stoplevels[stopidx - 1]) {
+ stopidx--;
+ continue;
+ }
if (gi >= 0 && stoplevels[stopidx] == gaschanges[gi].depth) {
o2 = dive->cylinder[gaschanges[gi].gasidx].gasmix.o2.permille;
he = dive->cylinder[gaschanges[gi].gasidx].gasmix.he.permille;