Skip mean depth comparison when no such data exist

Downloading dives from the dive computer attempts to merge same dives,
e.g. when multiple dive computers are used. If the mean depth is zero when
downloading from DC this comparison fails resulting in not merging the
multiple dive computers used on one dive. This patch skips the mean depth
comparison when this information is not available.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2013-02-16 19:04:03 +02:00 committed by Dirk Hohndel
parent 45c7ceb917
commit fd24237916

2
dive.c
View file

@ -1361,7 +1361,7 @@ static int likely_same_dive(struct dive *a, struct dive *b)
* have filled in during 'fixup_dive()'
*/
if (!similar(a->maxdepth.mm, b->maxdepth.mm, 1000) ||
!similar(a->meandepth.mm, b->meandepth.mm, 1000) ||
(a->meandepth.mm && b->meandepth.mm && !similar(a->meandepth.mm, b->meandepth.mm, 1000)) ||
!similar(a->duration.seconds, b->duration.seconds, 5*60))
return 0;