aboutsummaryrefslogtreecommitdiffstats
path: root/core/planner.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-10-30 22:10:57 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-31 16:33:32 -0700
commitc9c90afd3e7a44ee556b8ce4f01628f6d2281442 (patch)
tree95f6185d28636ef430ff0457fc31a19205396a06 /core/planner.c
parent0f458023d9ec0cba443fde522be7bb96bf56584f (diff)
downloadsubsurface-c9c90afd3e7a44ee556b8ce4f01628f6d2281442.tar.gz
Don't do the minimal gaschanging stops during O2 breakting
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/planner.c')
-rw-r--r--core/planner.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/planner.c b/core/planner.c
index 10ab65059..f0ce78c03 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -930,12 +930,12 @@ bool plan(struct diveplan *diveplan, struct dive *dive, int timestep, struct dec
(get_o2(&gas) + 5) / 10, (get_he(&gas) + 5) / 10, gaschanges[gi].depth / 1000.0);
#endif
/* Stop for the minimum duration to switch gas */
- add_segment(depth_to_bar(depth, dive),
- &dive->cylinder[current_cylinder].gasmix,
- prefs.min_switch_duration, po2, dive, prefs.decosac);
- clock += prefs.min_switch_duration;
- if (prefs.doo2breaks && get_o2(&dive->cylinder[current_cylinder].gasmix) == 1000)
- o2time += prefs.min_switch_duration;
+ if (!(prefs.doo2breaks && get_o2(&dive->cylinder[current_cylinder].gasmix) == 1000)) {
+ add_segment(depth_to_bar(depth, dive),
+ &dive->cylinder[current_cylinder].gasmix,
+ prefs.min_switch_duration, po2, dive, prefs.decosac);
+ clock += prefs.min_switch_duration;
+ }
} else {
/* The user has selected the option to switch gas only at required stops.
* Remember that we are waiting to switch gas
@@ -983,12 +983,12 @@ bool plan(struct diveplan *diveplan, struct dive *dive, int timestep, struct dec
(get_o2(&gas) + 5) / 10, (get_he(&gas) + 5) / 10, gaschanges[gi + 1].depth / 1000.0);
#endif
/* Stop for the minimum duration to switch gas */
- add_segment(depth_to_bar(depth, dive),
- &dive->cylinder[current_cylinder].gasmix,
- prefs.min_switch_duration, po2, dive, prefs.decosac);
- clock += prefs.min_switch_duration;
- if (prefs.doo2breaks && get_o2(&dive->cylinder[current_cylinder].gasmix) == 1000)
- o2time += prefs.min_switch_duration;
+ if (!(prefs.doo2breaks && get_o2(&dive->cylinder[current_cylinder].gasmix) == 1000)) {
+ add_segment(depth_to_bar(depth, dive),
+ &dive->cylinder[current_cylinder].gasmix,
+ prefs.min_switch_duration, po2, dive, prefs.decosac);
+ clock += prefs.min_switch_duration;
+ }
pendinggaschange = false;
}