Fix llGetLinkKey to report avatars properly

avinationmerge
Melanie 2011-12-09 16:36:25 +01:00
parent cf97809ff1
commit 07c26111af
1 changed files with 0 additions and 19 deletions

View File

@ -4117,25 +4117,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llGetLinkKey(int linknum) public LSL_String llGetLinkKey(int linknum)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
List<UUID> keytable = new List<UUID>();
// parse for sitting avatare-uuids
World.ForEachRootScenePresence(delegate(ScenePresence presence)
{
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
keytable.Add(presence.UUID);
});
int totalprims = m_host.ParentGroup.PrimCount + keytable.Count;
if (linknum > m_host.ParentGroup.PrimCount && linknum <= totalprims)
{
return keytable[totalprims - linknum].ToString();
}
if (linknum == 1 && m_host.ParentGroup.PrimCount == 1 && keytable.Count == 1)
{
return m_host.UUID.ToString();
}
SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum);
if (part != null) if (part != null)
{ {