diff options
author | UbitUmarov | 2017-07-11 02:33:48 +0100 |
---|---|---|
committer | UbitUmarov | 2017-07-11 02:33:48 +0100 |
commit | 72bce8c4b41406e8f19e263be634f2434bc54765 (patch) | |
tree | f75eb88ee9e0129c2da5e7d41a398b9c296984bf /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | SimpleAngularDistance update prioritization scheme ameks no sense without ord... (diff) | |
download | opensim-SC-72bce8c4b41406e8f19e263be634f2434bc54765.zip opensim-SC-72bce8c4b41406e8f19e263be634f2434bc54765.tar.gz opensim-SC-72bce8c4b41406e8f19e263be634f2434bc54765.tar.bz2 opensim-SC-72bce8c4b41406e8f19e263be634f2434bc54765.tar.xz |
do lsl object rez checks on script thread before wasting time possible creating a new poll thread
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index af88e4f..f4b7aa3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3534,32 +3534,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3534 | public void doObjectRez(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param, bool atRoot) | 3534 | public void doObjectRez(string inventory, LSL_Vector pos, LSL_Vector vel, LSL_Rotation rot, int param, bool atRoot) |
3535 | { | 3535 | { |
3536 | m_host.AddScriptLPS(1); | 3536 | m_host.AddScriptLPS(1); |
3537 | if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) | ||
3538 | return; | ||
3537 | 3539 | ||
3538 | Util.FireAndForget(x => | 3540 | float dist = (float)llVecDist(llGetPos(), pos); |
3539 | { | ||
3540 | if (Double.IsNaN(rot.x) || Double.IsNaN(rot.y) || Double.IsNaN(rot.z) || Double.IsNaN(rot.s)) | ||
3541 | return; | ||
3542 | 3541 | ||
3543 | float dist = (float)llVecDist(llGetPos(), pos); | 3542 | if (dist > m_ScriptDistanceFactor * 10.0f) |
3543 | return; | ||
3544 | 3544 | ||
3545 | if (dist > m_ScriptDistanceFactor * 10.0f) | 3545 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory); |
3546 | return; | ||
3547 | 3546 | ||
3548 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory); | 3547 | if (item == null) |
3548 | { | ||
3549 | Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'"); | ||
3550 | return; | ||
3551 | } | ||
3549 | 3552 | ||
3550 | if (item == null) | 3553 | if (item.InvType != (int)InventoryType.Object) |
3551 | { | 3554 | { |
3552 | Error("llRez(AtRoot/Object)", "Can't find object '" + inventory + "'"); | 3555 | Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database"); |
3553 | return; | 3556 | return; |
3554 | } | 3557 | } |
3555 | 3558 | ||
3556 | if (item.InvType != (int)InventoryType.Object) | 3559 | Util.FireAndForget(x => |
3557 | { | 3560 | { |
3558 | Error("llRez(AtRoot/Object)", "Can't create requested object; object is missing from database"); | ||
3559 | return; | ||
3560 | } | ||
3561 | 3561 | ||
3562 | List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, rot, vel, param, atRoot); | 3562 | Quaternion wrot = rot; |
3563 | wrot.Normalize(); | ||
3564 | List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, wrot, vel, param, atRoot); | ||
3563 | 3565 | ||
3564 | // If either of these are null, then there was an unknown error. | 3566 | // If either of these are null, then there was an unknown error. |
3565 | if (new_groups == null) | 3567 | if (new_groups == null) |