mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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
This commit is contained in:
@@ -1996,7 +1996,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public LSL_Float llGetTimeOfDay()
|
||||
{
|
||||
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()
|
||||
@@ -2009,7 +2009,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
TimeSpan ScriptTime = DateTime.Now - m_timer;
|
||||
return (double)((ScriptTime.TotalMilliseconds / 1000)*World.TimeDilation);
|
||||
return (double)(ScriptTime.TotalMilliseconds / 1000);
|
||||
}
|
||||
|
||||
public void llResetTime()
|
||||
@@ -2023,7 +2023,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.AddScriptLPS(1);
|
||||
TimeSpan ScriptTime = DateTime.Now - m_timer;
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user