aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-10-07 19:12:41 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-07 18:30:44 +0100
commit2f89a2e6e27a9c659e5f7f661b2b09a9178f550a (patch)
tree195af9de4e5ca4f4c7a939ab926a96e915e6de1e
parent937796bce9e99c04cf63ec3b111b7910df32091b (diff)
downloadsubsurface-2f89a2e6e27a9c659e5f7f661b2b09a9178f550a.tar.gz
Take dive's temperature into account for min/max temp
Generally we have the water temperature under divecomputer tag, but it might only be available one level up (under the dive tag). Thus we should take this into account in order to show the yearly/monthly statistics properly. Fixes #867 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--dive.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index 2fdedb10f..18101094e 100644
--- a/dive.c
+++ b/dive.c
@@ -1382,6 +1382,13 @@ struct dive *fixup_dive(struct dive *dive)
sanitize_cylinder_info(dive);
dive->maxcns = dive->cns;
+ /*
+ * Use the dive's temperatures for minimum and maximum in case
+ * we do not have temperatures recorded by DC.
+ */
+
+ update_min_max_temperatures(dive, dive->watertemp);
+
for_each_dc (dive, dc)
fixup_dive_dc(dive, dc);