summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2020-09-21 10:51:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-21 11:42:02 -0700
commitee7908028035b28d0ec110c65f0ebe212960352c (patch)
treedf86dc3adf13a8420d422039e7a662ebf24214f2
parentc33dd3808e6fdb5c341958f28e708caf0e2465f3 (diff)
downloadsubsurface-ee7908028035b28d0ec110c65f0ebe212960352c.tar.gz
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 <helling@atdotde.de>
-rw-r--r--core/planner.c2
1 files changed, 1 insertions, 1 deletions
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;