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>
This commit is contained in:
Robert C. Helling 2020-09-21 10:51:19 +02:00 committed by Dirk Hohndel
parent c33dd3808e
commit ee79080280

View file

@ -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;