aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authoridb2009-02-13 21:56:50 +0000
committeridb2009-02-13 21:56:50 +0000
commit63a1cab7fea2784f99aa2ef027ef878536973dc4 (patch)
tree830dfaffe8dd7f109134f352809be7316e6b53a1 /OpenSim/Region/ScriptEngine/Shared/Api
parent* minor: remove mono compiler warnings (diff)
downloadopensim-SC_OLD-63a1cab7fea2784f99aa2ef027ef878536973dc4.zip
opensim-SC_OLD-63a1cab7fea2784f99aa2ef027ef878536973dc4.tar.gz
opensim-SC_OLD-63a1cab7fea2784f99aa2ef027ef878536973dc4.tar.bz2
opensim-SC_OLD-63a1cab7fea2784f99aa2ef027ef878536973dc4.tar.xz
Correct llGetNumberOfPrims to include sitting avatars in the count.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-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