summaryrefslogtreecommitdiffstats
path: root/subsurface-core/dive.h
diff options
context:
space:
mode:
Diffstat (limited to 'subsurface-core/dive.h')
-rw-r--r--subsurface-core/dive.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/subsurface-core/dive.h b/subsurface-core/dive.h
index 0f5c43451..f8970b237 100644
--- a/subsurface-core/dive.h
+++ b/subsurface-core/dive.h
@@ -409,6 +409,8 @@ static inline int calculate_depth_to_mbar(int depth, pressure_t surface_pressure
mbar = SURFACE_PRESSURE;
if (!salinity)
salinity = SEAWATER_SALINITY;
+ if (salinity < 500)
+ salinity += FRESHWATER_SALINITY;
specific_weight = salinity / 10000.0 * 0.981;
mbar += rint(depth / 10.0 * specific_weight);
return mbar;