Bug in llGetNumberOfPrims always returns to script when no clients are connected to the simulator.

mysql-performance
Dan Lake 2010-01-11 17:28:27 -08:00 committed by John Hurliman
parent 22b1ffdc6c
commit a4a0512011
1 changed files with 3 additions and 14 deletions

View File

@ -7286,23 +7286,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetNumberOfPrims() public LSL_Integer llGetNumberOfPrims()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
ScenePresence[] presences = World.GetScenePresences();
if (presences.Length == 0)
return 0;
int avatarCount = 0; int avatarCount = 0;
for (int i = 0; i < presences.Length; i++) World.ForEachScenePresence(delegate(ScenePresence presence)
{ {
ScenePresence presence = presences[i]; if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
if (!presence.IsChildAgent && presence.ParentID != 0)
{
if (m_host.ParentGroup.HasChildPrim(presence.ParentID))
{
avatarCount++; avatarCount++;
} });
}
}
return m_host.ParentGroup.PrimCount + avatarCount; return m_host.ParentGroup.PrimCount + avatarCount;
} }