aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs58
1 files changed, 29 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1e530e1..5c54616 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2598,35 +2598,33 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
2598 2598
2599 List<Vector3> CoarseLocations = new List<Vector3>(); 2599 List<Vector3> CoarseLocations = new List<Vector3>();
2600 List<UUID> AvatarUUIDs = new List<UUID>(); 2600 List<UUID> AvatarUUIDs = new List<UUID>();
2601 List<ScenePresence> avatars = m_scene.GetAvatars(); 2601 m_scene.ForEachScenePresence(delegate(ScenePresence sp)
2602 for (int i = 0; i < avatars.Count; i++)
2603 { 2602 {
2604 // Requested by LibOMV. Send Course Location on self. 2603 if (sp.IsChildAgent)
2605 //if (avatars[i] != this) 2604 return;
2606 //{ 2605
2607 if (avatars[i].ParentID != 0) 2606 if (sp.ParentID != 0)
2607 {
2608 // sitting avatar
2609 SceneObjectPart sop = m_scene.GetSceneObjectPart(sp.ParentID);
2610 if (sop != null)
2608 { 2611 {
2609 // sitting avatar 2612 CoarseLocations.Add(sop.AbsolutePosition + sp.m_pos);
2610 SceneObjectPart sop = m_scene.GetSceneObjectPart(avatars[i].ParentID); 2613 AvatarUUIDs.Add(sp.UUID);
2611 if (sop != null)
2612 {
2613 CoarseLocations.Add(sop.AbsolutePosition + avatars[i].m_pos);
2614 AvatarUUIDs.Add(avatars[i].UUID);
2615 }
2616 else
2617 {
2618 // we can't find the parent.. ! arg!
2619 CoarseLocations.Add(avatars[i].m_pos);
2620 AvatarUUIDs.Add(avatars[i].UUID);
2621 }
2622 } 2614 }
2623 else 2615 else
2624 { 2616 {
2625 CoarseLocations.Add(avatars[i].m_pos); 2617 // we can't find the parent.. ! arg!
2626 AvatarUUIDs.Add(avatars[i].UUID); 2618 CoarseLocations.Add(sp.m_pos);
2619 AvatarUUIDs.Add(sp.UUID);
2627 } 2620 }
2628 //} 2621 }
2629 } 2622 else
2623 {
2624 CoarseLocations.Add(sp.m_pos);
2625 AvatarUUIDs.Add(sp.UUID);
2626 }
2627 });
2630 2628
2631 m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); 2629 m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations);
2632 2630
@@ -2700,13 +2698,15 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
2700 m_perfMonMS = Util.EnvironmentTickCount(); 2698 m_perfMonMS = Util.EnvironmentTickCount();
2701 2699
2702 // only send update from root agents to other clients; children are only "listening posts" 2700 // only send update from root agents to other clients; children are only "listening posts"
2703 List<ScenePresence> avatars = m_scene.GetAvatars(); 2701 int count = 0;
2704 foreach (ScenePresence avatar in avatars) 2702 m_scene.ForEachScenePresence(delegate(ScenePresence sp)
2705 { 2703 {
2706 SendFullUpdateToOtherClient(avatar); 2704 if (sp.IsChildAgent)
2707 2705 return;
2708 } 2706 SendFullUpdateToOtherClient(sp);
2709 m_scene.StatsReporter.AddAgentUpdates(avatars.Count); 2707 ++count;
2708 });
2709 m_scene.StatsReporter.AddAgentUpdates(count);
2710 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 2710 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2711 2711
2712 Animator.SendAnimPack(); 2712 Animator.SendAnimPack();