summaryrefslogtreecommitdiffstats
path: root/core/planner.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2019-01-10 21:18:53 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-01-13 15:02:07 -0800
commit2c794348c1060c8f6ce55c598c0a20690c4967f2 (patch)
treef5a47767117dd43ee20a878c7132b944e2609682 /core/planner.c
parent7f2c7aa7dee10d419fe3ce208d6a36cc1e93b580 (diff)
downloadsubsurface-2c794348c1060c8f6ce55c598c0a20690c4967f2.tar.gz
Planner: Add checkbox to force OC bailout
This adds a checkbox for rebreather modes of the planner that force the ascent to be in OC mode. Before, one had to add a one minute last segment with the mode change but this is not practical when manually searching for the maximal bottom time given gas reserves. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/planner.c')
-rw-r--r--core/planner.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/planner.c b/core/planner.c
index 1077fb313..3f5de00de 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -742,6 +742,10 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
printf("depth %5.2lfm \n", depth / 1000.0);
printf("current_cylinder %i\n", current_cylinder);
#endif
+ if ((divemode == CCR || divemode == PSCR) && prefs.dobailout) {
+ divemode = OC;
+ po2 = 0;
+ }
best_first_ascend_cylinder = current_cylinder;
/* Find the gases available for deco */