diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2013-02-16 19:04:03 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-16 11:07:01 -0800 |
commit | fd24237916263ab6ffcde7fbbf8dac8040eab80c (patch) | |
tree | 74e3a8663c8794dd9a868da905a09da62dc0cb26 /dive.c | |
parent | 45c7ceb917f31f84b151a2b48a7329cbfb44a02a (diff) | |
download | subsurface-fd24237916263ab6ffcde7fbbf8dac8040eab80c.tar.gz |
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>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |