From a8ce78bf775d9debef05ea697da240e85a7c8e80 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Thu, 14 Sep 2017 06:43:12 +0300 Subject: Refine cylinder usage tests Consider cylinder used also if the first and last sample pressure differ enough Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- core/statistics.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') diff --git a/core/statistics.c b/core/statistics.c index 4ce110d07..6ed859ca2 100644 --- a/core/statistics.c +++ b/core/statistics.c @@ -334,6 +334,10 @@ bool is_cylinder_used(struct dive *dive, int idx) if ((dive->cylinder[idx].start.mbar - dive->cylinder[idx].end.mbar) > SOME_GAS) return true; + + if ((dive->cylinder[idx].sample_start.mbar - dive->cylinder[idx].sample_end.mbar) > SOME_GAS) + return true; + for_each_dc(dive, dc) { if (has_gaschange_event(dive, dc, idx)) return true; -- cgit v1.2.3-70-g09d2