]> git.mxchange.org Git - flightgear.git/commitdiff
update based on property system rather than cur_fdm_state because cur_fdm_state
authorcurt <curt>
Mon, 29 Oct 2001 04:41:30 +0000 (04:41 +0000)
committercurt <curt>
Mon, 29 Oct 2001 04:41:30 +0000 (04:41 +0000)
may not always hold valid information.

src/Time/tmp.cxx

index 12584951449417807cea82ee6eb91a881805e78f..e4df6525176eb473d1119a92193ec308fb428484 100644 (file)
@@ -29,6 +29,7 @@
 #include <simgear/magvar/magvar.hxx>
 
 #include <FDM/flight.hxx>
+#include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 
 #include "light.hxx"
 
 // 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() );
 }