aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index cd17399..ed9d3ee 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6725,7 +6725,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6725 public LSL_Integer llGetNumberOfPrims() 6725 public LSL_Integer llGetNumberOfPrims()
6726 { 6726 {
6727 m_host.AddScriptLPS(1); 6727 m_host.AddScriptLPS(1);
6728 return m_host.ParentGroup.PrimCount; 6728 List<ScenePresence> presences = World.GetScenePresences();
6729 if (presences.Count == 0)
6730 return 0;
6731
6732 int avatarCount = 0;
6733 foreach (ScenePresence presence in presences)
6734 {
6735 if (!presence.IsChildAgent && presence.ParentID != 0)
6736 {
6737 if (m_host.ParentGroup.HasChildPrim(presence.ParentID))
6738 {
6739 avatarCount++;
6740 }
6741 }
6742 }
6743
6744 return m_host.ParentGroup.PrimCount + avatarCount;
6729 } 6745 }
6730 6746
6731 /// <summary> 6747 /// <summary>
@@ -8632,7 +8648,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8632 } 8648 }
8633 else 8649 else
8634 { 8650 {
8635 return part.ParentGroup.Children.Count; 8651 return part.ParentGroup.PrimCount;
8636 } 8652 }
8637 } 8653 }
8638 8654