From 19b221d2035b9ea899b17385ff52c807e7a10cdf Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 8 Jun 2022 10:55:50 -0700 Subject: [PATCH] core: add missing properties to the dive merge In a sign how few people use these additional properties AND use multiple dive computers, this took a couple of years to get noticed... but yes, we do need to merge those properties as well. Signed-off-by: Dirk Hohndel --- CHANGELOG.md | 4 ++++ core/dive.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f2c9cd329..14d091e49f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- core: merge all properties in a dive, including current, waveheight, etc - core: prevent crash when merging dives without cylinders (as we might get when importing from divelogs.de) - core: work around bug in TecDiving dive computer reporting spurious 0 deg C water temperature in first sample - core: correctly parse DC_FIELD_SALINITY response; fixes incorrect water type with some dive computers, including the Mares Smart @@ -6,6 +7,9 @@ - dive computer support - Garmin: correctly deal with short format filenames - Garmin: correctly parse dive mode + - Add support for the Seac Screen and Action + - Add support for the Cressi Michelangelo + --- * Always add new entries at the very top of this file above other existing entries and this note. diff --git a/core/dive.c b/core/dive.c index 39157f5d0b..5e6c2c0f13 100644 --- a/core/dive.c +++ b/core/dive.c @@ -2621,6 +2621,10 @@ struct dive *merge_dives(const struct dive *a, const struct dive *b, int offset, MERGE_TXT(res, a, b, suit, ", "); MERGE_MAX(res, a, b, number); MERGE_NONZERO(res, a, b, visibility); + MERGE_NONZERO(res, a, b, wavesize); + MERGE_NONZERO(res, a, b, current); + MERGE_NONZERO(res, a, b, surge); + MERGE_NONZERO(res, a, b, chill); copy_pictures(a->pictures.nr ? &a->pictures : &b->pictures, &res->pictures); taglist_merge(&res->tag_list, a->tag_list, b->tag_list); /* if we get dives without any gas / cylinder information in an import, make sure