diff --git a/CHANGELOG.md b/CHANGELOG.md index bcf6cbe8e..e0b2ee87a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- Fix a bug in planner for dives with manual gas changes. - Mobile: add full text filtering of the dive list - Desktop: don't add dive-buddy or dive-master when tabbing through fields - Filter: don't recalculate all filters on dive list-modifying operations diff --git a/core/dive.c b/core/dive.c index ae411d494..255f113fe 100644 --- a/core/dive.c +++ b/core/dive.c @@ -4447,7 +4447,7 @@ struct gasmix get_gasmix(const struct dive *dive, const struct divecomputer *dc, res = gasmix; } - while (ev && ev->time.seconds < time) { + while (ev && ev->time.seconds <= time) { res = get_gasmix_from_event(dive, ev); ev = get_next_event(ev->next, "gaschange"); } diff --git a/dives/test51.xml b/dives/test51.xml new file mode 100644 index 000000000..38c9ce8c7 --- /dev/null +++ b/dives/test51.xml @@ -0,0 +1,76 @@ + + + + + + + + + + This dive demostrates a planner bug. Edit this dive in planner. If the dive turns red for a ceiling violation, there is a bug in detecting the correct gasmix at times. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +