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) protected virtual void ScriptSleep(int delay)
{ {
delay = (int)((float)delay * m_ScriptDelayFactor); delay = (int)(delay * m_ScriptDelayFactor);
if (delay == 0) if (delay < 10)
return; return;
Sleep(delay); Sleep(delay);
@ -453,12 +453,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
protected virtual void Sleep(int delay) protected virtual void Sleep(int delay)
{ {
if (m_item == null) // Some unit tests don't set this if (m_item == null) // Some unit tests don't set this
{
Thread.Sleep(delay); Thread.Sleep(delay);
return; else
} m_ScriptEngine.SleepScript(m_item.ItemID, delay);
m_ScriptEngine.SleepScript(m_item.ItemID, delay);
} }
/// <summary> /// <summary>

View File

@ -485,10 +485,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
protected void ScriptSleep(int delay) protected void ScriptSleep(int delay)
{ {
delay = (int)((float)delay * m_ScriptDelayFactor); delay = (int)(delay * m_ScriptDelayFactor);
if (delay == 0) if (delay < 10)
return; 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) 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) protected override void ScriptSleep(int ms)
{ {
ms = (int)((float)ms * m_ScriptDelayFactor); ms = (int)(ms * m_ScriptDelayFactor);
if (ms == 0) if (ms < 10)
return; return;
inst.Sleep(ms); inst.Sleep(ms);