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>
This commit is contained in:
Anton Lundin 2013-10-06 18:39:21 +02:00 committed by Dirk Hohndel
parent 3e2faa4239
commit 9cbd0febbc

View file

@ -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;
}
}