aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-13 02:21:21 +0000
committerMelanie Thielker2009-05-13 02:21:21 +0000
commit6c2302637f22ac522de6dd76ffcd2dd05ee04ea8 (patch)
tree77bdf1d21d97dec376d126e24fec5d9b1566e750 /OpenSim
parentImplement llDetachFromAvatar() (diff)
downloadopensim-SC_OLD-6c2302637f22ac522de6dd76ffcd2dd05ee04ea8.zip
opensim-SC_OLD-6c2302637f22ac522de6dd76ffcd2dd05ee04ea8.tar.gz
opensim-SC_OLD-6c2302637f22ac522de6dd76ffcd2dd05ee04ea8.tar.bz2
opensim-SC_OLD-6c2302637f22ac522de6dd76ffcd2dd05ee04ea8.tar.xz
Implement llAttachToAvatar()
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs28
1 files changed, 27 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5700be5..a6080d6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2706,7 +2706,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2706 public void llAttachToAvatar(int attachment) 2706 public void llAttachToAvatar(int attachment)
2707 { 2707 {
2708 m_host.AddScriptLPS(1); 2708 m_host.AddScriptLPS(1);
2709 NotImplemented("llAttachToAvatar"); 2709
2710 if (m_host.ParentGroup.RootPart.AttachmentPoint == 0)
2711 return;
2712
2713 TaskInventoryItem item;
2714
2715 lock (m_host.TaskInventory)
2716 {
2717 if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
2718 return;
2719 else
2720 item = m_host.TaskInventory[InventorySelf()];
2721 }
2722
2723 if (item.PermsGranter != m_host.OwnerID)
2724 return;
2725
2726 if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
2727 {
2728 SceneObjectGroup grp = m_host.ParentGroup;
2729
2730 ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
2731
2732 m_ScriptEngine.World.AttachObject(presence.ControllingClient,
2733 grp.LocalId, (uint)attachment, Quaternion.Identity,
2734 Vector3.Zero, false);
2735 }
2710 } 2736 }
2711 2737
2712 public void llDetachFromAvatar() 2738 public void llDetachFromAvatar()