mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Don't delete the trip when splitting the only dive in a trip
When splitting dives make sure the new dives first are part of the same trip the original dive was in. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e964f533ff
commit
c30dfba433
1 changed files with 5 additions and 0 deletions
5
dive.c
5
dive.c
|
@ -2905,6 +2905,11 @@ static int split_dive_at(struct dive *dive, int a, int b)
|
||||||
|
|
||||||
fixup_dive(d1);
|
fixup_dive(d1);
|
||||||
fixup_dive(d2);
|
fixup_dive(d2);
|
||||||
|
if (dive->divetrip) {
|
||||||
|
d1->divetrip = d2->divetrip = 0;
|
||||||
|
add_dive_to_trip(d1, dive->divetrip);
|
||||||
|
add_dive_to_trip(d2, dive->divetrip);
|
||||||
|
}
|
||||||
|
|
||||||
if ((i = get_divenr(dive)) < 0)
|
if ((i = get_divenr(dive)) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue