summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2018-10-30 12:19:00 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2018-10-30 15:33:43 +0100
commit62c57be1da37ca9a95e424896025b875e30e4697 (patch)
tree7df0f3c8d2c92c13af6586168b3c66ee2a105ad9 /core/dive.c
parent7e4c8c387b4d72432c5fbdc922b60b7d3ff31277 (diff)
downloadsubsurface-62c57be1da37ca9a95e424896025b875e30e4697.tar.gz
Fix gasmix for OTU calculation
With the fixed sematics of get_gasmix to return the new gasmix for the time of a gas switch (added comments to make this clear), in the OTU calculation we need the previous gasmix for the interval up to the current time. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c
index 255f113fe..d6fba1714 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -4433,6 +4433,7 @@ int dive_has_gps_location(const struct dive *dive)
return dive_site_has_gps_location(dive->dive_site);
}
+/* When evaluated at the time of a gasswitch, this returns the new gas */
struct gasmix get_gasmix(const struct dive *dive, const struct divecomputer *dc, int time, const struct event **evp, struct gasmix gasmix)
{
const struct event *ev = *evp;
@@ -4456,6 +4457,7 @@ struct gasmix get_gasmix(const struct dive *dive, const struct divecomputer *dc,
}
/* get the gas at a certain time during the dive */
+/* If there is a gasswitch at that time, it returns the new gasmix */
struct gasmix get_gasmix_at_time(const struct dive *d, const struct divecomputer *dc, duration_t time)
{
const struct event *ev = NULL;