From ec044537d50b425178c4e081abcf325d28028480 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Thu, 18 Oct 2012 10:15:34 +0100 Subject: ensuring that operand order in llGetLinkName is internally consistent --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ac74bf8..42ab39a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3828,7 +3828,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } // simplest case, this prims link number - if (m_host.LinkNum == linknum) + if (linknum == m_host.LinkNum) return m_host.Name; // Single prim -- cgit v1.1 From 597df51f918327f2ac46bc452a3288ec624e029f Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Thu, 18 Oct 2012 10:16:42 +0100 Subject: the simplest case for llGetLinkName also applies to the LINK_THIS constant --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 42ab39a..e8d0bea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3828,7 +3828,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } // simplest case, this prims link number - if (linknum == m_host.LinkNum) + if (linknum == m_host.LinkNum || linknum == ScriptBaseClass.LINK_THIS) return m_host.Name; // Single prim -- cgit v1.1 From 645e3171b41be4c5611bb43a9c14ec1d501ff8b9 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Thu, 18 Oct 2012 10:18:46 +0100 Subject: since llGetLinkName has a "simplest case", it should be the first check made. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e8d0bea..e8bf5cf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3804,6 +3804,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetLinkName(int linknum) { m_host.AddScriptLPS(1); + // simplest case, this prims link number + if (linknum == m_host.LinkNum || linknum == ScriptBaseClass.LINK_THIS) + return m_host.Name; + // parse for sitting avatare-names List nametable = new List(); World.ForEachRootScenePresence(delegate(ScenePresence presence) @@ -3827,10 +3831,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return nametable[totalprims - linknum]; } - // simplest case, this prims link number - if (linknum == m_host.LinkNum || linknum == ScriptBaseClass.LINK_THIS) - return m_host.Name; - // Single prim if (m_host.LinkNum == 0) { -- cgit v1.1 From af5383e479e264f2c257ff802f258bd03550e4b4 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Thu, 18 Oct 2012 10:22:41 +0100 Subject: altering documentation for llGetLinkName, as the current documentation is rather lengthy for a "summary". --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e8bf5cf..cf801ba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3773,6 +3773,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } /// + /// Returns the name of the child prim or seated avatar matching the + /// specified link number. + /// + /// + /// The number of a link in the linkset or a link-related constant. + /// + /// + /// The name determined to match the specified link number. + /// + /// /// The rules governing the returned name are not simple. The only /// time a blank name is returned is if the target prim has a blank /// name. If no prim with the given link number can be found then @@ -3800,7 +3810,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// Mentions NULL_KEY being returned /// http://wiki.secondlife.com/wiki/LlGetLinkName /// Mentions using the LINK_* constants, some of which are negative - /// + /// public LSL_String llGetLinkName(int linknum) { m_host.AddScriptLPS(1); -- cgit v1.1