Fix invalid bailout gas choice when planning a CCR dive.

Fixes a bug reported in
https://groups.google.com/g/subsurface-divelog/c/8N3cTz2Zv5E:
When planning a CCR dive with OC bailout, the diluent gas may be chosen
as the first OC bailout gas, despite being set up with a use type of
'diluent', and likely not being available for open circuit breathing.
`best_first_ascend_cylinder` is now initialised to an invalid value
(instead of the first cylinder, which may or may not be a diluent
 cylinder), and its subsequent use is guarded by a validity check.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2023-02-16 15:53:17 +13:00 committed by Robert C. Helling
parent eb5d4f2a15
commit ec0c6833a0
4 changed files with 91 additions and 9 deletions

View file

@ -19,6 +19,7 @@ private slots:
void testVpmbMetric100m10min();
void testVpmbMetricRepeat();
void testMultipleGases();
void testCcrBailoutGasSelection();
};
#endif // TESTPLAN_H