a few changes to ScriptSleep() functions
parent
4e4d687f3f
commit
e6615a193d
|
@ -443,8 +443,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
protected virtual void ScriptSleep(int delay)
|
||||
{
|
||||
delay = (int)((float)delay * m_ScriptDelayFactor);
|
||||
if (delay == 0)
|
||||
delay = (int)(delay * m_ScriptDelayFactor);
|
||||
if (delay < 10)
|
||||
return;
|
||||
|
||||
Sleep(delay);
|
||||
|
@ -453,12 +453,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
protected virtual void Sleep(int delay)
|
||||
{
|
||||
if (m_item == null) // Some unit tests don't set this
|
||||
{
|
||||
Thread.Sleep(delay);
|
||||
return;
|
||||
}
|
||||
|
||||
m_ScriptEngine.SleepScript(m_item.ItemID, delay);
|
||||
else
|
||||
m_ScriptEngine.SleepScript(m_item.ItemID, delay);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -485,10 +485,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
protected void ScriptSleep(int delay)
|
||||
{
|
||||
delay = (int)((float)delay * m_ScriptDelayFactor);
|
||||
if (delay == 0)
|
||||
delay = (int)(delay * m_ScriptDelayFactor);
|
||||
if (delay < 10)
|
||||
return;
|
||||
System.Threading.Thread.Sleep(delay);
|
||||
if(m_item != null)
|
||||
m_ScriptEngine.SleepScript(m_item.ItemID, delay);
|
||||
else
|
||||
Thread.Sleep(delay);
|
||||
}
|
||||
|
||||
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
|
||||
|
|
|
@ -61,8 +61,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine
|
|||
|
||||
protected override void ScriptSleep(int ms)
|
||||
{
|
||||
ms = (int)((float)ms * m_ScriptDelayFactor);
|
||||
if (ms == 0)
|
||||
ms = (int)(ms * m_ScriptDelayFactor);
|
||||
if (ms < 10)
|
||||
return;
|
||||
|
||||
inst.Sleep(ms);
|
||||
|
|
Loading…
Reference in New Issue