From 9cbd0febbc60038d4ba140bf5ea66a74eb542c01 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Sun, 6 Oct 2013 18:39:21 +0200 Subject: Make is_gas_used work with SAMPLE_EVENT_GASCHANGE SAMPLE_EVENT_GASCHANGE only contains o2 part, and not the he part so when looking at ex the gaslist for dives/test20.xml it got it realy wrong. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- statistics.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/statistics.c b/statistics.c index 09d9d9e54..ce41df8a9 100644 --- a/statistics.c +++ b/statistics.c @@ -318,7 +318,11 @@ bool is_gas_used(struct dive *dive, int idx) if (is_air(o2, he)) { if (is_air(event_o2 * 10, event_he * 10)) used = TRUE; - } else if (he == event_he * 10 && o2 == event_o2 * 10) { + } else if (event->type == 25 && he == event_he * 10 && o2 == event_o2 * 10) { + /* SAMPLE_EVENT_GASCHANGE2(25) contains both o2 and he */ + used = TRUE; + } else if (o2 == event_o2 * 10) { + /* SAMPLE_EVENT_GASCHANGE(11) only contains o2 */ used = TRUE; } } -- cgit v1.2.3-70-g09d2