Only create a new list to check if objects have reached targets if there actually are any targets.

0.7.4-extended
Justin Clark-Casey (justincc) 2012-10-30 01:48:05 +00:00
parent 5498a64a9f
commit fe503de17a
1 changed files with 9 additions and 5 deletions

View File

@ -1648,15 +1648,19 @@ namespace OpenSim.Region.Framework.Scenes
private void CheckAtTargets()
{
List<SceneObjectGroup> objs = new List<SceneObjectGroup>();
List<SceneObjectGroup> objs = null;
lock (m_groupsWithTargets)
{
foreach (SceneObjectGroup grp in m_groupsWithTargets.Values)
objs.Add(grp);
if (m_groupsWithTargets.Count != 0)
objs = new List<SceneObjectGroup>(m_groupsWithTargets.Values);
}
foreach (SceneObjectGroup entry in objs)
entry.checkAtTargets();
if (objs != null)
{
foreach (SceneObjectGroup entry in objs)
entry.checkAtTargets();
}
}
/// <summary>