mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
a31499de88
commit
ea9b179933
1 changed files with 3 additions and 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue