since llGetLinkName has a "simplest case", it should be the first check made.

connector_plugin
SignpostMarv 2012-10-18 10:18:46 +01:00 committed by Justin Clark-Casey (justincc)
parent 597df51f91
commit 645e3171b4
1 changed files with 4 additions and 4 deletions

View File

@ -3804,6 +3804,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llGetLinkName(int linknum) public LSL_String llGetLinkName(int linknum)
{ {
m_host.AddScriptLPS(1); 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 // parse for sitting avatare-names
List<String> nametable = new List<String>(); List<String> nametable = new List<String>();
World.ForEachRootScenePresence(delegate(ScenePresence presence) World.ForEachRootScenePresence(delegate(ScenePresence presence)
@ -3827,10 +3831,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return nametable[totalprims - linknum]; 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 // Single prim
if (m_host.LinkNum == 0) if (m_host.LinkNum == 0)
{ {