Remove use of time dilation in llGetTimeOfDay, llGetTime and llGetAndResetTime.

It is not documented to be applied to llGetTimeOfDay at all and is not appropriate for the other two because dilation does not directly affect script speed in OS.
Fixes Mantis #2783 and #2162
0.6.1-post-fixes
idb 2008-12-14 17:48:27 +00:00
parent 8ad6f575eb
commit 7c6c443503
1 changed files with 3 additions and 3 deletions

View File

@ -1996,7 +1996,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Float llGetTimeOfDay() public LSL_Float llGetTimeOfDay()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
return (double)(((DateTime.Now.TimeOfDay.TotalMilliseconds / 1000) % (3600 * 4)) * World.TimeDilation); return (double)((DateTime.Now.TimeOfDay.TotalMilliseconds / 1000) % (3600 * 4));
} }
public LSL_Float llGetWallclock() public LSL_Float llGetWallclock()
@ -2009,7 +2009,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
TimeSpan ScriptTime = DateTime.Now - m_timer; TimeSpan ScriptTime = DateTime.Now - m_timer;
return (double)((ScriptTime.TotalMilliseconds / 1000)*World.TimeDilation); return (double)(ScriptTime.TotalMilliseconds / 1000);
} }
public void llResetTime() public void llResetTime()
@ -2023,7 +2023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
TimeSpan ScriptTime = DateTime.Now - m_timer; TimeSpan ScriptTime = DateTime.Now - m_timer;
m_timer = DateTime.Now; m_timer = DateTime.Now;
return (double)((ScriptTime.TotalMilliseconds / 1000)*World.TimeDilation); return (double)(ScriptTime.TotalMilliseconds / 1000);
} }
public void llSound(string sound, double volume, int queue, int loop) public void llSound(string sound, double volume, int queue, int loop)