summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/dive.c b/dive.c
index 269aeb658..8ce1c950f 100644
--- a/dive.c
+++ b/dive.c
@@ -361,11 +361,7 @@ void per_cylinder_mean_depth(struct dive *dive, struct divecomputer *dc, int *me
int time = sample->time.seconds;
int depth = sample->depth.mm;
if (ev && time >= ev->time.seconds) {
- int o2 = (ev->value & 0xFFFF) * 10;
- int he = (ev->value >> 16) * 10;
- int tank = get_gasidx(dive, o2, he);
- if (tank >= 0)
- idx = tank; // should never happen unless the input file is inconsistent
+ idx = get_cylinder_index(dive, ev);
ev = get_next_event(ev->next, "gaschange");
}
/* We ignore segments at the surface */