summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Monty Taylor <mordred@inaugust.com>2020-05-04 08:54:58 -0500
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2020-05-05 17:31:47 +0300
commit95e6792c4fe353441fd1cad8bad8b459b1a37d65 (patch)
tree93c002bf9ac52e1b7b73d526976912a73766da75 /core/dive.c
parentb3270222fd884c2b1c68519bdadf7fbc357a5d06 (diff)
downloadsubsurface-95e6792c4fe353441fd1cad8bad8b459b1a37d65.tar.gz
Grantlee: Add salinity and water type to grantlee variables
These can be useful in a printed divelog, especially if the log entry is also showing weight and exposure suit. Signed-off-by: Monty Taylor <mordred@inaugust.com>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c
index 2073099e2..00add41e6 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -1196,6 +1196,11 @@ static void fixup_water_salinity(struct dive *dive)
dive->salinity = (sum + nr / 2) / nr;
}
+int get_dive_salinity(const struct dive *dive)
+{
+ return dive->user_salinity ? dive->user_salinity : dive->salinity;
+}
+
static void fixup_meandepth(struct dive *dive)
{
struct divecomputer *dc;