diff options
author | UbitUmarov | 2018-09-04 22:19:30 +0100 |
---|---|---|
committer | UbitUmarov | 2018-09-04 22:19:30 +0100 |
commit | e6615a193dcfe36238708febdeda34b03e1bbf1e (patch) | |
tree | c4c81501c3a286a25b73051846ea66bfb56a98c3 | |
parent | Add YEngine support for ScriptDelayFactor (diff) | |
download | opensim-SC-e6615a193dcfe36238708febdeda34b03e1bbf1e.zip opensim-SC-e6615a193dcfe36238708febdeda34b03e1bbf1e.tar.gz opensim-SC-e6615a193dcfe36238708febdeda34b03e1bbf1e.tar.bz2 opensim-SC-e6615a193dcfe36238708febdeda34b03e1bbf1e.tar.xz |
a few changes to ScriptSleep() functions
3 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 47610a1..6ffc0fc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -443,8 +443,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
443 | 443 | ||
444 | protected virtual void ScriptSleep(int delay) | 444 | protected virtual void ScriptSleep(int delay) |
445 | { | 445 | { |
446 | delay = (int)((float)delay * m_ScriptDelayFactor); | 446 | delay = (int)(delay * m_ScriptDelayFactor); |
447 | if (delay == 0) | 447 | if (delay < 10) |
448 | return; | 448 | return; |
449 | 449 | ||
450 | Sleep(delay); | 450 | Sleep(delay); |
@@ -453,12 +453,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
453 | protected virtual void Sleep(int delay) | 453 | protected virtual void Sleep(int delay) |
454 | { | 454 | { |
455 | if (m_item == null) // Some unit tests don't set this | 455 | if (m_item == null) // Some unit tests don't set this |
456 | { | ||
457 | Thread.Sleep(delay); | 456 | Thread.Sleep(delay); |
458 | return; | 457 | else |
459 | } | 458 | m_ScriptEngine.SleepScript(m_item.ItemID, delay); |
460 | |||
461 | m_ScriptEngine.SleepScript(m_item.ItemID, delay); | ||
462 | } | 459 | } |
463 | 460 | ||
464 | /// <summary> | 461 | /// <summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index c4f2ef7..62729b3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -485,10 +485,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
485 | 485 | ||
486 | protected void ScriptSleep(int delay) | 486 | protected void ScriptSleep(int delay) |
487 | { | 487 | { |
488 | delay = (int)((float)delay * m_ScriptDelayFactor); | 488 | delay = (int)(delay * m_ScriptDelayFactor); |
489 | if (delay == 0) | 489 | if (delay < 10) |
490 | return; | 490 | return; |
491 | System.Threading.Thread.Sleep(delay); | 491 | if(m_item != null) |
492 | m_ScriptEngine.SleepScript(m_item.ItemID, delay); | ||
493 | else | ||
494 | Thread.Sleep(delay); | ||
492 | } | 495 | } |
493 | 496 | ||
494 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) | 497 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) |
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs index 332085f..b6f8874 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstBackend.cs | |||
@@ -61,8 +61,8 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
61 | 61 | ||
62 | protected override void ScriptSleep(int ms) | 62 | protected override void ScriptSleep(int ms) |
63 | { | 63 | { |
64 | ms = (int)((float)ms * m_ScriptDelayFactor); | 64 | ms = (int)(ms * m_ScriptDelayFactor); |
65 | if (ms == 0) | 65 | if (ms < 10) |
66 | return; | 66 | return; |
67 | 67 | ||
68 | inst.Sleep(ms); | 68 | inst.Sleep(ms); |