diff options
Diffstat (limited to 'core/divelist.c')
-rw-r--r-- | core/divelist.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/divelist.c b/core/divelist.c index d51aedf78..60b398539 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -316,10 +316,13 @@ static int calculate_sac(struct dive *dive) static void add_dive_to_deco(struct dive *dive) { struct divecomputer *dc = &dive->dc; + struct gasmix *gasmix = NULL; + struct event *ev = NULL; int i; if (!dc) return; + for (i = 1; i < dc->samples; i++) { struct sample *psample = dc->sample + i - 1; struct sample *sample = dc->sample + i; @@ -329,8 +332,8 @@ static void add_dive_to_deco(struct dive *dive) for (j = t0; j < t1; j++) { int depth = interpolate(psample->depth.mm, sample->depth.mm, j - t0, t1 - t0); - add_segment(depth_to_bar(depth, dive), - &dive->cylinder[sample->sensor[0]].gasmix, 1, sample->setpoint.mbar, dive, dive->sac); + gasmix = get_gasmix(dive, dc, j, &ev, gasmix); + add_segment(depth_to_bar(depth, dive), gasmix, 1, sample->setpoint.mbar, dive, dive->sac); } } } |