summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dive.c b/dive.c
index ae9ecde00..c76b71056 100644
--- a/dive.c
+++ b/dive.c
@@ -1077,8 +1077,6 @@ struct dive *try_to_merge(struct dive *a, struct dive *b, gboolean prefer_downlo
*/
if ((a->when >= b->when + 60) || (a->when <= b->when - 60))
return NULL;
- if (prefer_downloaded && a->when != b->when)
- return NULL;
if (!prefer_downloaded) {
/* Dive 'a' is 'offset' seconds before dive 'b' */
offset = find_sample_offset(a, b);
@@ -1093,10 +1091,12 @@ struct dive *merge_dives(struct dive *a, struct dive *b, int offset, gboolean pr
struct dive *res = alloc_dive();
struct dive *dl = NULL;
- if (a->downloaded)
- dl = a;
- else if (b->downloaded)
- dl = b;
+ if (prefer_downloaded) {
+ if (a->downloaded)
+ dl = a;
+ else if (b->downloaded)
+ dl = b;
+ }
res->when = a->when;
res->selected = a->selected || b->selected;
merge_trip(res, a, b);