a few changes to ScriptSleep() functions

0.9.1.0-post-fixes
UbitUmarov 2018-09-04 22:19:30 +01:00
parent 4e4d687f3f
commit e6615a193d
3 changed files with 12 additions and 12 deletions

View File

@ -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>

View File

@ -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)

View File

@ -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);