From: curt Date: Tue, 3 Jul 2001 16:45:34 +0000 (+0000) Subject: Rather than create an SGTime structure and trigger a spurious X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=db40b8c48b673860c2b7e6842109a7d01b4eac54;p=flightgear.git Rather than create an SGTime structure and trigger a spurious "*** NO TIMEZONE" error message, just grab the modified julian date directly. --- diff --git a/src/Navaids/nav.hxx b/src/Navaids/nav.hxx index 967b6a3cc..b5563ee45 100644 --- a/src/Navaids/nav.hxx +++ b/src/Navaids/nav.hxx @@ -103,12 +103,11 @@ operator >> ( istream& in, FGNav& n ) char c /* , magvar_dir */ ; string magvar_s; - static SGTime time_params; static bool first_time = true; static double julian_date = 0; + static const double MJD0 = 2415020.0; if ( first_time ) { - time_params.update( 0.0, 0.0, 0 ); - julian_date = time_params.getJD(); + julian_date = sgTimeCurrentMJD( 0 ) + MJD0; first_time = false; } @@ -129,9 +128,11 @@ operator >> ( istream& in, FGNav& n ) // cout << "lat = " << n.lat << " lon = " << n.lon << " elev = " // << n.elev << " JD = " // << julian_date << endl; - n.magvar = sgGetMagVar(n.lon * SGD_DEGREES_TO_RADIANS, n.lat * SGD_DEGREES_TO_RADIANS, - n.elev * SG_FEET_TO_METER, - julian_date) * SGD_RADIANS_TO_DEGREES; + n.magvar = sgGetMagVar( n.lon * SGD_DEGREES_TO_RADIANS, + n.lat * SGD_DEGREES_TO_RADIANS, + n.elev * SG_FEET_TO_METER, + julian_date ) + * SGD_RADIANS_TO_DEGREES; // cout << "Default variation at " << n.lon << ',' << n.lat // << " is " << var << endl; #if 0