diff options
author | Robert C. Helling <helling@atdotde.de> | 2018-04-27 20:12:02 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-04-29 22:50:10 +0300 |
commit | d75f7474c781ee2d3b4f8c39bf296c47484d2f05 (patch) | |
tree | 19f0cedeb4002dc944c19c1cc177c965a4735f5d /core | |
parent | a0b80ca775e9ad4b840293f959d933e94d120fb8 (diff) | |
download | subsurface-d75f7474c781ee2d3b4f8c39bf296c47484d2f05.tar.gz |
When looking for gas change events only use those
This function looks for the last gas change before a
given time. We should initialize it with a gaschange
event as we might later use this event to read a
gasmix from it.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core')
-rw-r--r-- | core/dive.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/dive.h b/core/dive.h index acbb6eb27..795203545 100644 --- a/core/dive.h +++ b/core/dive.h @@ -960,7 +960,7 @@ static inline struct gasmix *get_gasmix(struct dive *dive, struct divecomputer * if (!gasmix) { int cyl = explicit_first_cylinder(dive, dc); gasmix = &dive->cylinder[cyl].gasmix; - ev = dc ? dc->events : NULL; + ev = dc ? get_next_event(dc->events, "gaschange") : NULL; } while (ev && ev->time.seconds < time) { gasmix = get_gasmix_from_event(dive, ev); |