From 971f2383ffae43f347dd4c7816adcbbdf0c0634e Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 29 Oct 2001 04:41:30 +0000 Subject: [PATCH] update based on property system rather than cur_fdm_state because cur_fdm_state may not always hold valid information. --- src/Time/tmp.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Time/tmp.cxx b/src/Time/tmp.cxx index 125849514..e4df65251 100644 --- a/src/Time/tmp.cxx +++ b/src/Time/tmp.cxx @@ -29,6 +29,7 @@ #include #include +#include
#include
#include "light.hxx" @@ -39,11 +40,18 @@ // periodic time updater wrapper void fgUpdateLocalTime() { + static const SGPropertyNode *longitude + = fgGetNode("/position/longitude-deg"); + static const SGPropertyNode *latitude + = fgGetNode("/position/latitude-deg"); + SGPath zone( globals->get_fg_root() ); zone.append( "Timezone" ); - globals->get_time_params()->updateLocal( cur_fdm_state->get_Longitude(), - cur_fdm_state->get_Latitude(), + globals->get_time_params()->updateLocal( longitude->getDoubleValue() + * SGD_DEGREES_TO_RADIANS, + latitude->getDoubleValue() + * SGD_DEGREES_TO_RADIANS, zone.str() ); } -- 2.39.5