]> git.mxchange.org Git - flightgear.git/commitdiff
Fix METAR-download bug on Windows.
authorJames Turner <zakalawe@mac.com>
Wed, 1 Jan 2014 21:05:29 +0000 (21:05 +0000)
committerJames Turner <zakalawe@mac.com>
Wed, 1 Jan 2014 21:05:29 +0000 (21:05 +0000)
https://code.google.com/p/flightgear-bugs/issues/detail?id=1207

Use the new (in SimGear) sgGMTime helper when comparing METAR age.
This prevents users in time-zones 4 or more hours ahead of GMT from
being unable to use METAR reports.

src/Environment/fgmetar.cxx

index 26d33bc7aaeb6edab8363850d97622e7c5d66b20..6cee2c29d257310664f5c75b1352f963c842e326 100644 (file)
@@ -38,6 +38,8 @@
 
 #include <simgear/math/sg_random.h>
 #include <simgear/timing/sg_time.hxx>
+#include <simgear/timing/lowleveltime.h>
+
 #include <Main/fg_props.hxx>
 
 #include "fgmetar.hxx"
@@ -158,7 +160,7 @@ FGMetar::FGMetar(const string& icao) :
 
 long FGMetar::getAge_min() const
 {
-       time_t now = _x_proxy ? _rq_time : time(0);
+       time_t now = _x_proxy ? _rq_time : sgGMTime();
        return (now - _time) / 60;
 }