mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Correctly handle merging dives that are part of a trip
If we have already created a dive_trip structure we need to also copy the link. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cfb1baa030
commit
a544d74044
1 changed files with 5 additions and 2 deletions
7
dive.c
7
dive.c
|
@ -711,10 +711,13 @@ struct dive *try_to_merge(struct dive *a, struct dive *b)
|
|||
|
||||
res->when = a->when;
|
||||
/* the larger tripflag is more relevant */
|
||||
if(a->tripflag > b->tripflag)
|
||||
if(a->tripflag > b->tripflag) {
|
||||
res->tripflag = a->tripflag;
|
||||
else
|
||||
res->divetrip = a->divetrip;
|
||||
} else {
|
||||
res->tripflag = b->tripflag;
|
||||
res->divetrip = b->divetrip;
|
||||
}
|
||||
MERGE_NONZERO(res, a, b, latitude);
|
||||
MERGE_NONZERO(res, a, b, longitude);
|
||||
MERGE_TXT(res, a, b, location);
|
||||
|
|
Loading…
Add table
Reference in a new issue