summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2020-06-02 11:52:25 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-13 13:51:07 -0700
commit3426c6440c0700ca24d34c000f88361a778b0942 (patch)
tree37ee9234c769c5364b5591c74d84bcfea62e2748 /core
parentc29e2f972e7c7e577dfea6b7b6bb673c39eff79e (diff)
downloadsubsurface-3426c6440c0700ca24d34c000f88361a778b0942.tar.gz
Disable SAC factor setting for CCR dives
The SAC factor is only used for minimal gas calculations which don't make sense in the CCR context. Additionally, make bailout stop for at least minimum switch time or problem solving time. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core')
-rw-r--r--core/planner.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/planner.c b/core/planner.c
index aaabeddf7..ded265c36 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -825,11 +825,12 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
if ((divemode == CCR || divemode == PSCR) && prefs.dobailout) {
divemode = OC;
po2 = 0;
+ int bailoutsegment = MAX(prefs.min_switch_duration, 60 * prefs.problemsolvingtime);
add_segment(ds, depth_to_bar(depth, dive),
get_cylinder(dive, current_cylinder)->gasmix,
- prefs.min_switch_duration, po2, divemode, prefs.bottomsac);
- plan_add_segment(diveplan, prefs.min_switch_duration, depth, current_cylinder, po2, false, divemode);
- clock += prefs.min_switch_duration;
+ bailoutsegment, po2, divemode, prefs.bottomsac);
+ plan_add_segment(diveplan, bailoutsegment, depth, current_cylinder, po2, false, divemode);
+ clock += bailoutsegment;
last_segment_min_switch = true;
}
previous_deco_time = 100000000;