diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9f3e354..877c3cb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3065,9 +3065,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3065 | { | 3065 | { |
3066 | m_host.AddScriptLPS(1); | 3066 | m_host.AddScriptLPS(1); |
3067 | 3067 | ||
3068 | if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) | ||
3069 | return; | ||
3070 | |||
3071 | TaskInventoryItem item; | 3068 | TaskInventoryItem item; |
3072 | 3069 | ||
3073 | m_host.TaskInventory.LockItemsForRead(true); | 3070 | m_host.TaskInventory.LockItemsForRead(true); |
@@ -3093,11 +3090,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3093 | 3090 | ||
3094 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 3091 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
3095 | 3092 | ||
3093 | /* | ||
3096 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | 3094 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; |
3097 | if (attachmentsModule != null) | 3095 | if (attachmentsModule != null) |
3096 | { | ||
3098 | attachmentsModule.AttachObject( | 3097 | attachmentsModule.AttachObject( |
3099 | presence.ControllingClient, grp.LocalId, | 3098 | presence.ControllingClient, grp.LocalId, |
3100 | (uint)attachment, Quaternion.Identity, Vector3.Zero, false); | 3099 | (uint)attachment, Quaternion.Identity, Vector3.Zero, false); |
3100 | } | ||
3101 | */ | ||
3102 | grp.AttachToAgent(m_host.OwnerID, (uint)attachment, Vector3.Zero, false); | ||
3101 | } | 3103 | } |
3102 | } | 3104 | } |
3103 | 3105 | ||
@@ -9470,8 +9472,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9470 | { | 9472 | { |
9471 | m_host.AddScriptLPS(1); | 9473 | m_host.AddScriptLPS(1); |
9472 | DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, 0); | 9474 | DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, 0); |
9473 | if (detectedParams == null) return; // only works on the first detected avatar | 9475 | if (detectedParams == null) |
9474 | 9476 | { | |
9477 | if (m_host.IsAttachment == true) | ||
9478 | { | ||
9479 | detectedParams = new DetectParams(); | ||
9480 | detectedParams.Key = m_host.OwnerID; | ||
9481 | } | ||
9482 | else | ||
9483 | { | ||
9484 | return; | ||
9485 | } | ||
9486 | } | ||
9487 | |||
9475 | ScenePresence avatar = World.GetScenePresence(detectedParams.Key); | 9488 | ScenePresence avatar = World.GetScenePresence(detectedParams.Key); |
9476 | if (avatar != null) | 9489 | if (avatar != null) |
9477 | { | 9490 | { |
@@ -9479,6 +9492,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9479 | new Vector3((float)pos.x, (float)pos.y, (float)pos.z), | 9492 | new Vector3((float)pos.x, (float)pos.y, (float)pos.z), |
9480 | new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z)); | 9493 | new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z)); |
9481 | } | 9494 | } |
9495 | |||
9482 | ScriptSleep(1000); | 9496 | ScriptSleep(1000); |
9483 | } | 9497 | } |
9484 | 9498 | ||