diff options
author | Melanie Thielker | 2009-05-13 02:06:12 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-13 02:06:12 +0000 |
commit | 4cce1cc26ed8832764408fd44a279301eb55aa80 (patch) | |
tree | 2d760ae9f20159846557cb6d14e5a2b508d7f344 /OpenSim/Region/ScriptEngine | |
parent | Add interface, stub implementation and (diff) | |
download | opensim-SC-4cce1cc26ed8832764408fd44a279301eb55aa80.zip opensim-SC-4cce1cc26ed8832764408fd44a279301eb55aa80.tar.gz opensim-SC-4cce1cc26ed8832764408fd44a279301eb55aa80.tar.bz2 opensim-SC-4cce1cc26ed8832764408fd44a279301eb55aa80.tar.xz |
Implement llDetachFromAvatar()
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 28 |
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 e2bdd59..5700be5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2712,7 +2712,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2712 | public void llDetachFromAvatar() | 2712 | public void llDetachFromAvatar() |
2713 | { | 2713 | { |
2714 | m_host.AddScriptLPS(1); | 2714 | m_host.AddScriptLPS(1); |
2715 | NotImplemented("llDetachFromAvatar"); | 2715 | |
2716 | if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) | ||
2717 | return; | ||
2718 | |||
2719 | TaskInventoryItem item; | ||
2720 | |||
2721 | lock (m_host.TaskInventory) | ||
2722 | { | ||
2723 | if (!m_host.TaskInventory.ContainsKey(InventorySelf())) | ||
2724 | return; | ||
2725 | else | ||
2726 | item = m_host.TaskInventory[InventorySelf()]; | ||
2727 | } | ||
2728 | |||
2729 | if (item.PermsGranter != m_host.OwnerID) | ||
2730 | return; | ||
2731 | |||
2732 | if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) | ||
2733 | { | ||
2734 | SceneObjectGroup grp = m_host.ParentGroup; | ||
2735 | UUID itemID = grp.GetFromAssetID(); | ||
2736 | |||
2737 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | ||
2738 | |||
2739 | m_ScriptEngine.World.DetachSingleAttachmentToInv(itemID, | ||
2740 | presence.ControllingClient); | ||
2741 | } | ||
2716 | } | 2742 | } |
2717 | 2743 | ||
2718 | public void llTakeCamera(string avatar) | 2744 | public void llTakeCamera(string avatar) |