update based on property system rather than cur_fdm_state because cur_fdm_state
may not always hold valid information.
This commit is contained in:
parent
15f02e9dd6
commit
971f2383ff
1 changed files with 10 additions and 2 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <simgear/magvar/magvar.hxx>
|
#include <simgear/magvar/magvar.hxx>
|
||||||
|
|
||||||
#include <FDM/flight.hxx>
|
#include <FDM/flight.hxx>
|
||||||
|
#include <Main/fg_props.hxx>
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
|
|
||||||
#include "light.hxx"
|
#include "light.hxx"
|
||||||
|
@ -39,11 +40,18 @@
|
||||||
|
|
||||||
// periodic time updater wrapper
|
// periodic time updater wrapper
|
||||||
void fgUpdateLocalTime() {
|
void fgUpdateLocalTime() {
|
||||||
|
static const SGPropertyNode *longitude
|
||||||
|
= fgGetNode("/position/longitude-deg");
|
||||||
|
static const SGPropertyNode *latitude
|
||||||
|
= fgGetNode("/position/latitude-deg");
|
||||||
|
|
||||||
SGPath zone( globals->get_fg_root() );
|
SGPath zone( globals->get_fg_root() );
|
||||||
zone.append( "Timezone" );
|
zone.append( "Timezone" );
|
||||||
|
|
||||||
globals->get_time_params()->updateLocal( cur_fdm_state->get_Longitude(),
|
globals->get_time_params()->updateLocal( longitude->getDoubleValue()
|
||||||
cur_fdm_state->get_Latitude(),
|
* SGD_DEGREES_TO_RADIANS,
|
||||||
|
latitude->getDoubleValue()
|
||||||
|
* SGD_DEGREES_TO_RADIANS,
|
||||||
zone.str() );
|
zone.str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue