1
0
Fork 0

Fix compilation bug that only occurred when compiled with weathercm subsystem enabled

This commit is contained in:
daveluff 2003-01-13 19:03:36 +00:00
parent 9bff823e0a
commit 2fb9a21f2d

View file

@ -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 ";