mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Only warn about different number of tanks and gases if there are tanks
Some backends support giving tank data for some, but not all models that they support (and simply report no tanks for those models that don't support this). The Suunto Vyper is one of the dive computers where this happens and without this change we report angry red warnings after a perfectly correct download. So this changes the logic to only show that error if there actually were tanks reported. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b5fcfc8867
commit
956d189734
1 changed files with 1 additions and 1 deletions
|
@ -77,7 +77,7 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
|
||||||
int ntanks = 0;
|
int ntanks = 0;
|
||||||
rc = dc_parser_get_field(parser, DC_FIELD_TANK_COUNT, 0, &ntanks);
|
rc = dc_parser_get_field(parser, DC_FIELD_TANK_COUNT, 0, &ntanks);
|
||||||
if (rc == DC_STATUS_SUCCESS) {
|
if (rc == DC_STATUS_SUCCESS) {
|
||||||
if (ntanks != ngases) {
|
if (ntanks && ntanks != ngases) {
|
||||||
shown_warning = true;
|
shown_warning = true;
|
||||||
report_error("different number of gases (%d) and tanks (%d)", ngases, ntanks);
|
report_error("different number of gases (%d) and tanks (%d)", ngases, ntanks);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue