From 580a7f07dd1ae83d0705f6aa0ba58b6424bef0a0 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 1 Jan 2014 21:05:29 +0000 Subject: [PATCH] Fix METAR-download bug on Windows. 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Environment/fgmetar.cxx b/src/Environment/fgmetar.cxx index 26d33bc7a..6cee2c29d 100644 --- a/src/Environment/fgmetar.cxx +++ b/src/Environment/fgmetar.cxx @@ -38,6 +38,8 @@ #include #include +#include + #include
#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; }