summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/planner.c b/planner.c
index 63f1f6364..be6986679 100644
--- a/planner.c
+++ b/planner.c
@@ -1076,10 +1076,15 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
previous_point_time = clock;
stopping = true;
}
+
+ /* Deco stop should end when runtime is at a whole minute */
+ int this_decotimestep;
+ this_decotimestep = DECOTIMESTEP - clock % DECOTIMESTEP;
+
tissue_tolerance = add_segment(depth_to_mbar(depth, &displayed_dive) / 1000.0,
&displayed_dive.cylinder[current_cylinder].gasmix,
- DECOTIMESTEP, po2, &displayed_dive, prefs.decosac);
- clock += DECOTIMESTEP;
+ this_decotimestep, po2, &displayed_dive, prefs.decosac);
+ clock += this_decotimestep;
/* Finish infinite deco */
if(clock >= 48 * 3600 && depth >= 6000) {
error = LONGDECO;