From d018ceb8523dfa78da4bf508b9f7f829cd423e02 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Tue, 8 May 2018 16:08:07 +0200 Subject: Planner: Honor last manual divemode Start the decompression schedule in the divemode of the last manual section. Signed-off-by: Robert C. Helling --- core/planner.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/planner.c b/core/planner.c index 40424cc61..d3a41121d 100644 --- a/core/planner.c +++ b/core/planner.c @@ -735,7 +735,9 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i current_cylinder = get_cylinderid_at_time(dive, &dive->dc, sample->time); // FIXME: This needs a function to find the divemode at the end of the dive like in - // divemode = get_current_divemode(&dive->dc, 1e5, &ev, &divemode); + struct event *ev = NULL; + divemode = UNDEF_COMP_TYPE; + divemode = get_current_divemode(&dive->dc, bottom_time, &ev, &divemode); gas = dive->cylinder[current_cylinder].gasmix; po2 = sample->setpoint.mbar; -- cgit v1.2.3-70-g09d2