aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDan Lake2010-01-11 17:28:27 -0800
committerJohn Hurliman2010-01-12 10:23:36 -0800
commita4a0512011d53a0d8ed64151fd8500481768e2c7 (patch)
tree6753256b414fdb3d3b9a6b3325e10db559d2fcd0 /OpenSim
parentFix repeated ArgumentOutOfRangeException when a local OpenSim console is resi... (diff)
downloadopensim-SC_OLD-a4a0512011d53a0d8ed64151fd8500481768e2c7.zip
opensim-SC_OLD-a4a0512011d53a0d8ed64151fd8500481768e2c7.tar.gz
opensim-SC_OLD-a4a0512011d53a0d8ed64151fd8500481768e2c7.tar.bz2
opensim-SC_OLD-a4a0512011d53a0d8ed64151fd8500481768e2c7.tar.xz
Bug in llGetNumberOfPrims always returns to script when no clients are connected to the simulator.
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 }