diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 9195063..3823ff8 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -2781,7 +2781,37 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2781 | public void llCreateLink(string target, int parent) | 2781 | public void llCreateLink(string target, int parent) |
2782 | { | 2782 | { |
2783 | m_host.AddScriptLPS(1); | 2783 | m_host.AddScriptLPS(1); |
2784 | NotImplemented("llCreateLink"); | 2784 | LLUUID invItemID = InventorySelf(); |
2785 | if ((m_host.TaskInventory[invItemID].PermsMask & BuiltIn_Commands_BaseClass.PERMISSION_CHANGE_LINKS) == 0) { | ||
2786 | ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!"); | ||
2787 | return; | ||
2788 | } | ||
2789 | IClientAPI client = World.GetScenePresence(m_host.TaskInventory[invItemID].PermsGranter).ControllingClient; | ||
2790 | SceneObjectPart targetPart = World.GetSceneObjectPart(target); | ||
2791 | SceneObjectGroup parentPrim = null, childPrim = null; | ||
2792 | if (targetPart != null) | ||
2793 | { | ||
2794 | if (parent == BuiltIn_Commands_BaseClass.TRUE) { | ||
2795 | parentPrim = m_host.ParentGroup; | ||
2796 | childPrim = targetPart.ParentGroup; | ||
2797 | } | ||
2798 | else | ||
2799 | { | ||
2800 | parentPrim = targetPart.ParentGroup; | ||
2801 | childPrim = m_host.ParentGroup; | ||
2802 | } | ||
2803 | byte uf = childPrim.RootPart.UpdateFlag; | ||
2804 | childPrim.RootPart.UpdateFlag = 0; | ||
2805 | parentPrim.LinkToGroup(childPrim); | ||
2806 | childPrim.RootPart.UpdateFlag = uf; | ||
2807 | } | ||
2808 | parentPrim.TriggerScriptChangedEvent(Changed.LINK); | ||
2809 | parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); | ||
2810 | parentPrim.GetProperties(client); | ||
2811 | |||
2812 | // sleep for 1 second | ||
2813 | System.Threading.Thread.Sleep(1000); | ||
2814 | |||
2785 | } | 2815 | } |
2786 | 2816 | ||
2787 | public void llBreakLink(int linknum) | 2817 | public void llBreakLink(int linknum) |