From ee7908028035b28d0ec110c65f0ebe212960352c Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 21 Sep 2020 10:51:19 +0200 Subject: Bailout segment is part of bottom time The clock is only valid in ascent. In each cycle of the 'critial volume algorithm' it re-initialized to the bottom time at the beginning of deco. So the time spent on bailout should be added to this bottom time. Thanks to Coverty for spotting this. Coverity-scan: CID-362079 Signed-off-by: Robert C. Helling --- core/planner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/planner.c b/core/planner.c index ded265c36..475be1a20 100644 --- a/core/planner.c +++ b/core/planner.c @@ -830,7 +830,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i get_cylinder(dive, current_cylinder)->gasmix, bailoutsegment, po2, divemode, prefs.bottomsac); plan_add_segment(diveplan, bailoutsegment, depth, current_cylinder, po2, false, divemode); - clock += bailoutsegment; + bottom_time += bailoutsegment; last_segment_min_switch = true; } previous_deco_time = 100000000; -- cgit v1.2.3-70-g09d2