summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-10-06 18:39:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-06 11:19:53 -0700
commit9cbd0febbc60038d4ba140bf5ea66a74eb542c01 (patch)
tree66252bd4de006338116213c3c3f2ed6f8afefa8f
parent3e2faa4239bff6e7e7906e7de2203e8fdd248b1e (diff)
downloadsubsurface-9cbd0febbc60038d4ba140bf5ea66a74eb542c01.tar.gz
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 <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--statistics.c6
1 files changed, 5 insertions, 1 deletions
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;
}
}