From 528fcede6c31c056c3863fd19528558fcbaf475f Mon Sep 17 00:00:00 2001 From: Pixel Tomsen Date: Mon, 26 Sep 2011 20:18:06 +0200 Subject: [PATCH] llAvatarOnLinkSitTarget Implementation http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget --- .../Shared/Api/Implementation/LSL_Api.cs | 14 ++++++++++++++ .../ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 070cdc04b9..39da563a55 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6296,6 +6296,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return m_host.GetAvatarOnSitTarget().ToString(); } + // http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget + public LSL_String llAvatarOnLinkSitTarget(int linknum) + { + m_host.AddScriptLPS(1); + if(linknum == ScriptBaseClass.LINK_SET || + linknum == ScriptBaseClass.LINK_ALL_CHILDREN || + linknum == ScriptBaseClass.LINK_ALL_OTHERS) return UUID.Zero.ToString(); + + List parts = GetLinkParts(linknum); + if (parts.Count == 0) return UUID.Zero.ToString(); + return parts[0].SitTargetAvatar.ToString(); + } + + public void llAddToLandPassList(string avatar, double hours) { m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 4d7d60d6f6..62e2854998 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -54,6 +54,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Float llAtan2(double x, double y); void llAttachToAvatar(int attachment); LSL_Key llAvatarOnSitTarget(); + LSL_Key llAvatarOnLinkSitTarget(int linknum); LSL_Rotation llAxes2Rot(LSL_Vector fwd, LSL_Vector left, LSL_Vector up); LSL_Rotation llAxisAngle2Rot(LSL_Vector axis, double angle); LSL_Integer llBase64ToInteger(string str); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 96e46fdb60..508f33b13f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -129,6 +129,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_LSL_Functions.llAvatarOnSitTarget(); } + public LSL_Key llAvatarOnLinkSitTarget(int linknum) + { + return m_LSL_Functions.llAvatarOnLinkSitTarget(linknum); + } + public LSL_Rotation llAxes2Rot(LSL_Vector fwd, LSL_Vector left, LSL_Vector up) { return m_LSL_Functions.llAxes2Rot(fwd, left, up);