From a3bf3a2aa5f0213d238ac31e279dd729bc872769 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 f0e0f1a1ce..14aaa86c3c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7891,14 +7891,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(); } ///