From 4041cb54f34749dafa7eb976ec84ac640c3d12ec Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 4 Jan 2013 20:56:39 +0000 Subject: [PATCH] refactor: simplify llGetNumberOfPrims() to return prim count + sitting avatar count rather than independently inspecting every scene presence --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1a7cd3fe24..92277b226c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7814,14 +7814,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetNumberOfPrims() { m_host.AddScriptLPS(1); - int avatarCount = 0; - World.ForEachRootScenePresence(delegate(ScenePresence presence) - { - if (presence.ParentID != 0 && m_host.ParentGroup.ContainsPart(presence.ParentID)) - avatarCount++; - }); - return m_host.ParentGroup.PrimCount + avatarCount; + return m_host.ParentGroup.PrimCount + m_host.ParentGroup.GetSittingAvatarsCount(); } ///