Really save airtemp and watertemp in the dive

I thought I had this fixed, but a silly thinko broke my fix.
Only abort the saving if both air AND water temperature are already
covered by the divecomputer(s) in a dive. If at least one of them is
different, then create a divetemperature tag and fill in that value at the
dive level.

Fixes #313

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-06 20:13:12 -08:00
parent df464fcef1
commit 379fa5f652

View file

@ -155,7 +155,7 @@ static void save_dive_temperature(FILE *f, struct dive *dive)
{
if (!dive->airtemp.mkelvin && !dive->watertemp.mkelvin)
return;
if (dive->airtemp.mkelvin == dc_airtemp(&dive->dc) || dive->watertemp.mkelvin == dc_watertemp(&dive->dc))
if (dive->airtemp.mkelvin == dc_airtemp(&dive->dc) && dive->watertemp.mkelvin == dc_watertemp(&dive->dc))
return;
fputs(" <divetemperature", f);