mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
fix: actually default bottom gas to air
If there are no gas mixes returned by libdivecomputer, we need to default to air. The previous commit would have defaulted to pure oxygen. Signed-off-by: Micha WERLE <micha@michaelwerle.com>
This commit is contained in:
parent
4842344bc1
commit
c612641517
1 changed files with 5 additions and 2 deletions
|
@ -123,7 +123,7 @@ static struct gasmix get_deeper_gasmix(struct gasmix a, struct gasmix b)
|
||||||
if (get_o2(a) < get_o2(b)) {
|
if (get_o2(a) < get_o2(b)) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
if (get_o2(a) > get_o2(b))
|
if (get_o2(a) > get_o2(b)) {
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
return get_he(a) < get_he(b) ? b : a;
|
return get_he(a) < get_he(b) ? b : a;
|
||||||
|
@ -161,7 +161,10 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool no_volume = true;
|
bool no_volume = true;
|
||||||
struct gasmix bottom_gas = { {1000}, {0} }; /* Default to pure O2 */
|
struct gasmix bottom_gas = { {1000}, {0} }; /* Default to pure O2, or air if there are no mixes defined */
|
||||||
|
if (ngases == 0) {
|
||||||
|
bottom_gas = gasmix_air;
|
||||||
|
}
|
||||||
|
|
||||||
clear_cylinder_table(&dive->cylinders);
|
clear_cylinder_table(&dive->cylinders);
|
||||||
for (i = 0; i < MAX(ngases, ntanks); i++) {
|
for (i = 0; i < MAX(ngases, ntanks); i++) {
|
||||||
|
|
Loading…
Reference in a new issue