diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-10-03 07:11:11 -0400 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-03 07:17:29 -0400 |
commit | c30dfba433eb6e46d88a0c25cea7c4f47cb55f33 (patch) | |
tree | 548203d9b0149f182176862610497b4af514f64b /dive.c | |
parent | e964f533ff8fdc8411dccf414ee8b91c0aa3dfe8 (diff) | |
download | subsurface-c30dfba433eb6e46d88a0c25cea7c4f47cb55f33.tar.gz |
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>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2905,6 +2905,11 @@ static int split_dive_at(struct dive *dive, int a, int b) fixup_dive(d1); 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) return 0; |