From 46412f49313472f1665f864e3b631fcdeeff70da Mon Sep 17 00:00:00 2001 From: meta7 Date: Sun, 22 Aug 2010 09:32:40 -0700 Subject: Fix llGetLinkKey and llGetNumberOfPrims to play nice with avatars in the linkset (emulated) --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9615d08..b4134a4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3988,7 +3988,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (linknum > m_host.ParentGroup.PrimCount || (linknum == 1 && m_host.ParentGroup.PrimCount == 1)) { linknum -= (m_host.ParentGroup.PrimCount) + 1; - if (linknum > 0) linknum--; //for linksets List avatars = GetLinkAvatars(ScriptBaseClass.LINK_SET); if (avatars.Count > linknum) @@ -7807,13 +7806,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetNumberOfPrims() { m_host.AddScriptLPS(1); - int avatarCount = 0; - World.ForEachScenePresence(delegate(ScenePresence presence) - { - if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) - avatarCount++; - }); - + int avatarCount = m_host.ParentGroup.GetLinkedAvatars().Count; + return m_host.ParentGroup.PrimCount + avatarCount; } -- cgit v1.1