aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs17
1 files changed, 3 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 39b597e..b9defbe 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7286,23 +7286,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7286 public LSL_Integer llGetNumberOfPrims() 7286 public LSL_Integer llGetNumberOfPrims()
7287 { 7287 {
7288 m_host.AddScriptLPS(1); 7288 m_host.AddScriptLPS(1);
7289 ScenePresence[] presences = World.GetScenePresences();
7290 if (presences.Length == 0)
7291 return 0;
7292
7293 int avatarCount = 0; 7289 int avatarCount = 0;
7294 for (int i = 0; i < presences.Length; i++) 7290 World.ForEachScenePresence(delegate(ScenePresence presence)
7295 { 7291 {
7296 ScenePresence presence = presences[i]; 7292 if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
7297
7298 if (!presence.IsChildAgent && presence.ParentID != 0)
7299 {
7300 if (m_host.ParentGroup.HasChildPrim(presence.ParentID))
7301 {
7302 avatarCount++; 7293 avatarCount++;
7303 } 7294 });
7304 }
7305 }
7306 7295
7307 return m_host.ParentGroup.PrimCount + avatarCount; 7296 return m_host.ParentGroup.PrimCount + avatarCount;
7308 } 7297 }