mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
Fix bug for CCR dive bailout
Under some conditions get_current_divemode() (in dive.c) returns an erroneous divemode. This happens when there are several events at the very beginning of the dive, as can happen in some CCR dive logs. This commit fixes that bug. Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
This commit is contained in:
parent
718f9811b7
commit
9c24d6bef8
1 changed files with 2 additions and 1 deletions
|
@ -253,7 +253,8 @@ enum dive_comp_type get_current_divemode(struct divecomputer *dc, int time, stru
|
|||
ev = dc ? dc->events : NULL;
|
||||
}
|
||||
while (ev && ev->time.seconds < time) {
|
||||
*divemode = (enum dive_comp_type) ev->value;
|
||||
if (ev != dc->events)
|
||||
*divemode = (enum dive_comp_type) ev->value;
|
||||
ev = get_next_event(ev->next, "modechange");
|
||||
}
|
||||
*evp = ev;
|
||||
|
|
Loading…
Add table
Reference in a new issue