diff options
author | Anton Lundin <glance@acc.umu.se> | 2013-11-20 23:21:05 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-20 14:36:12 -0800 |
commit | ea9b1799337f5bb82c41f4f5288da24b85f6ae50 (patch) | |
tree | 370d8a638bb1a9a24d7903d58c0ba3233bee29cd /profile.c | |
parent | a31499de88fc341bf2818bb4c6440ce707d99647 (diff) | |
download | subsurface-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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; } |