aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 1985e72..c9998c0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7285,23 +7285,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7285 public LSL_Integer llGetNumberOfPrims() 7285 public LSL_Integer llGetNumberOfPrims()
7286 { 7286 {
7287 m_host.AddScriptLPS(1); 7287 m_host.AddScriptLPS(1);
7288 ScenePresence[] presences = World.GetScenePresences();
7289 if (presences.Length == 0)
7290 return 0;
7291
7292 int avatarCount = 0; 7288 int avatarCount = 0;
7293 for (int i = 0; i < presences.Length; i++) 7289 World.ForEachScenePresence(delegate(ScenePresence presence)
7294 { 7290 {
7295 ScenePresence presence = presences[i]; 7291 if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
7296
7297 if (!presence.IsChildAgent && presence.ParentID != 0)
7298 {
7299 if (m_host.ParentGroup.HasChildPrim(presence.ParentID))
7300 {
7301 avatarCount++; 7292 avatarCount++;
7302 } 7293 });
7303 }
7304 }
7305 7294
7306 return m_host.ParentGroup.PrimCount + avatarCount; 7295 return m_host.ParentGroup.PrimCount + avatarCount;
7307 } 7296 }