X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FEnvironment%2Ffgmetar.cxx;h=b2b331fbf223469aec3b00e99fec829bb0906266;hb=11d15b451347674fba77648700d23c5aaec3c6c2;hp=d12d0018905b8019151a212dc9f7e3a6cdb03dab;hpb=ecc6548d71104bad07b5d55833e5871078f2dc46;p=flightgear.git diff --git a/src/Environment/fgmetar.cxx b/src/Environment/fgmetar.cxx index d12d00189..b2b331fbf 100644 --- a/src/Environment/fgmetar.cxx +++ b/src/Environment/fgmetar.cxx @@ -36,10 +36,6 @@ #include #endif -#ifdef HAVE_WINDOWS_H -#include -#endif - #include #include #include
@@ -103,14 +99,16 @@ FGMetar::FGMetar(const string& icao, const string& proxy, const string& port, co _wind_range_from = _wind_range_to = _wind_dir; } + if (_wind_speed == SGMetarNaN) + _wind_speed = 0.0; if (_gust_speed == SGMetarNaN) _gust_speed = 0.0; // clouds vector cv = _clouds; - vector::iterator cloud; + vector::iterator cloud, cv_end = cv.end(); - for (i = 0, cloud = cv.begin(); cloud != cv.end(); cloud++, i++) { + for (i = 0, cloud = cv.begin(); cloud != cv_end; ++cloud, i++) { int cov = cloud->getCoverage(); if (cov == -1) cov = 0; @@ -135,8 +133,8 @@ FGMetar::FGMetar(const string& icao, const string& proxy, const string& port, co // snow cover map rm = getRunways(); - map::const_iterator runway; - for (runway = rm.begin(); runway != rm.end(); runway++) { + map::const_iterator runway, rm_end = rm.end(); + for (runway = rm.begin(); runway != rm_end; ++runway) { SGMetarRunway rwy = runway->second; if (rwy.getDeposit() >= 3 ) { _snow_cover = true;