diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 5224f84..0314562 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules | |||
81 | private double SunSpeed; // Rate of passage in radians/second | 81 | private double SunSpeed; // Rate of passage in radians/second |
82 | private double SeasonSpeed; // Rate of change for seasonal effects | 82 | private double SeasonSpeed; // Rate of change for seasonal effects |
83 | private double HoursToRadians; // Rate of change for seasonal effects | 83 | private double HoursToRadians; // Rate of change for seasonal effects |
84 | private long m_offset = 0; // seconds offset from UTC | 84 | private long TicksOffset = 0; // seconds offset from UTC |
85 | // Calculated every update | 85 | // Calculated every update |
86 | private float OrbitalPosition; // Orbital placement at a point in time | 86 | private float OrbitalPosition; // Orbital placement at a point in time |
87 | private double HorizonShift; // Axis offset to skew day and night | 87 | private double HorizonShift; // Axis offset to skew day and night |
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules | |||
100 | private ulong CurrentTime | 100 | private ulong CurrentTime |
101 | { | 101 | { |
102 | get { | 102 | get { |
103 | return (ulong)(((System.DateTime.Now.Ticks)-TicksToEpoch)/10000000 + m_offset); | 103 | return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000); |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
@@ -117,7 +117,9 @@ namespace OpenSim.Region.Environment.Modules | |||
117 | m_frame = 0; | 117 | m_frame = 0; |
118 | 118 | ||
119 | TimeZone local = TimeZone.CurrentTimeZone; | 119 | TimeZone local = TimeZone.CurrentTimeZone; |
120 | m_offset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Seconds; | 120 | TicksOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; |
121 | |||
122 | m_log.Debug("[SUN] localtime offset is " + TicksOffset); | ||
121 | 123 | ||
122 | // Align ticks with Second Life | 124 | // Align ticks with Second Life |
123 | 125 | ||