From 0a59fd74e2937152048cb8d56bae88cbcf139bee Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 25 Nov 2015 12:08:28 -0800 Subject: 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 --- subsurface-core/libdivecomputer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3-70-g09d2