From: daveluff Date: Mon, 13 Jan 2003 19:03:36 +0000 (+0000) Subject: Fix compilation bug that only occurred when compiled with weathercm subsystem enabled X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2fb9a21f2d94f67720a2626fd14086e1482bcca0;p=flightgear.git Fix compilation bug that only occurred when compiled with weathercm subsystem enabled --- diff --git a/src/ATC/atis.cxx b/src/ATC/atis.cxx index a4653cc61..25eba6d10 100644 --- a/src/ATC/atis.cxx +++ b/src/ATC/atis.cxx @@ -147,22 +147,20 @@ void FGATIS::UpdateTransmission() { transmission = transmission + " / Weather " + ConvertNumToSpokenDigits((time_str.substr(0,3) + "00")) + " hours zulu"; // Get the temperature - // (Hardwire it for now since the global property returns the temperature at the current altitude - //temperature = fgGetDouble("/environment/weather/temperature-K"); + int temp; #ifdef FG_WEATHERCM - sprintf(buf, "%i", int(stationweather.Temperature - 273.15)); + temp = int(stationweather.Temperature - 273.15); #else + temp = (int)stationweather.get_temperature_degc(); + #endif + // HACK ALERT - at the moment the new environment subsystem returns bogus temperatures // FIXME - take out this hack when this gets fixed upstream - int temp = (int)stationweather.get_temperature_degc(); if((temp < -50) || (temp > 60)) { temp = 15; } - // original: - //sprintf(buf, "%d", int(stationweather.get_temperature_degc())); - // hack: - sprintf(buf, "%d", temp); - #endif + + sprintf(buf, "%i", abs(temp)); transmission += " / Temperature "; if(temp < 0) { transmission += "minus ";