refactor: simplify llGetNumberOfPrims() to return prim count + sitting avatar count rather than independently inspecting every scene presence

0.7.4-extended
Justin Clark-Casey (justincc) 2013-01-04 20:56:39 +00:00
parent 87b4f335af
commit 4041cb54f3
1 changed files with 1 additions and 7 deletions

View File

@ -7814,14 +7814,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetNumberOfPrims() public LSL_Integer llGetNumberOfPrims()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
int avatarCount = 0;
World.ForEachRootScenePresence(delegate(ScenePresence presence)
{
if (presence.ParentID != 0 && m_host.ParentGroup.ContainsPart(presence.ParentID))
avatarCount++;
});
return m_host.ParentGroup.PrimCount + avatarCount; return m_host.ParentGroup.PrimCount + m_host.ParentGroup.GetSittingAvatarsCount();
} }
/// <summary> /// <summary>