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>
This commit is contained in:
Robert C. Helling 2018-04-27 20:12:02 +02:00 committed by Lubomir I. Ivanov
parent a0b80ca775
commit d75f7474c7

View file

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