summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/dive.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c
index 0b0cbd671..8cec50407 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -2155,6 +2155,11 @@ static void merge_one_cylinder(cylinder_t *a, cylinder_t *b)
a->start.mbar = b->start.mbar;
if (!a->end.mbar)
a->end.mbar = b->end.mbar;
+
+ if (a->sample_start.mbar && b->sample_start.mbar)
+ a->sample_start.mbar = a->sample_start.mbar > b->sample_start.mbar ? a->sample_start.mbar : b->sample_start.mbar;
+ if (a->sample_end.mbar && b->sample_end.mbar)
+ a->sample_end.mbar = a->sample_end.mbar < b->sample_end.mbar ? a->sample_end.mbar : b->sample_end.mbar;
}
/*