mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
refactor: simplify llGetNumberOfPrims() to return prim count + sitting avatar count rather than independently inspecting every scene presence
This commit is contained in:
@@ -7891,14 +7891,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>
|
||||||
|
|||||||
Reference in New Issue
Block a user