summaryrefslogtreecommitdiffstats
path: root/subsurface-core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-25 12:08:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-25 12:08:28 -0800
commit0a59fd74e2937152048cb8d56bae88cbcf139bee (patch)
treea685766bd88fd62b1c5a9986c30961928af4be6e /subsurface-core
parent23cb9b49c23c80eeafa59925e42e2c52c6eb6a72 (diff)
downloadsubsurface-0a59fd74e2937152048cb8d56bae88cbcf139bee.tar.gz
Don't overwrite air temperature
If we already have an air temperature set, don't overwrite it with potentially less accurate infromation from the first sample. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core')
-rw-r--r--subsurface-core/libdivecomputer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/subsurface-core/libdivecomputer.c b/subsurface-core/libdivecomputer.c
index ca8378379..8ed29edd7 100644
--- a/subsurface-core/libdivecomputer.c
+++ b/subsurface-core/libdivecomputer.c
@@ -695,7 +695,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
dc_parser_destroy(parser);
/* Various libdivecomputer interface fixups */
- if (first_temp_is_air && dive->dc.samples) {
+ if (dive->dc.airtemp.mkelvin == 0 && first_temp_is_air && dive->dc.samples) {
dive->dc.airtemp = dive->dc.sample[0].temperature;
dive->dc.sample[0].temperature.mkelvin = 0;
}