summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2018-10-29 23:55:38 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2018-10-30 15:33:43 +0100
commitd9f2b537afcefb57e224a6d1527537a54bb60688 (patch)
tree11569c338db65a6eedfbdb5200cdbc9b766a77dc /core
parenta0cc02dfe8a82e12dc1eb902eeb906b2f9edc80b (diff)
downloadsubsurface-d9f2b537afcefb57e224a6d1527537a54bb60688.tar.gz
Fixed get_gas_at_time for equal times
This fixes a subtle bug introduced in 5c4569247a31c which unified two functions finding the gasmix at a given time during the dive. There was a slight difference, though: Does a gaschange exactly at that time count or not? For the planner to work, the answer has to be in the affirmative. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core')
-rw-r--r--core/dive.c2
1 files changed, 1 insertions, 1 deletions
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");
}