summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-11-20 23:21:05 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-20 14:36:12 -0800
commitea9b1799337f5bb82c41f4f5288da24b85f6ae50 (patch)
tree370d8a638bb1a9a24d7903d58c0ba3233bee29cd /profile.c
parenta31499de88fc341bf2818bb4c6440ce707d99647 (diff)
downloadsubsurface-ea9b1799337f5bb82c41f4f5288da24b85f6ae50.tar.gz
Don't interpolate gas consumption when at surface
Don't calculate pressure-track for depth above SURFACE_THRESHOLD, because then we would guess that were actually at surface breathing. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index 0f90370f0..453da991a 100644
--- a/profile.c
+++ b/profile.c
@@ -496,6 +496,9 @@ static inline int pressure_time(struct dive *dive, struct divecomputer *dc, stru
int time = b->sec - a->sec;
int depth = (a->depth + b->depth)/2;
+ if (depth <= SURFACE_THRESHOLD)
+ return 0;
+
return depth_to_mbar(depth, dive) * time;
}