aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Prioritizer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Prioritizer.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs28
1 files changed, 18 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 19f8180..f9599f5 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -218,20 +218,28 @@ namespace OpenSim.Region.Framework.Scenes
218 218
219 private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) 219 private double GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity)
220 { 220 {
221 ScenePresence presence = m_scene.GetScenePresence(client.AgentId); 221 // If this is an update for our own avatar give it the highest priority
222 if (presence != null) 222 if (client.AgentId == entity.UUID)
223 { 223 return 0.0;
224 // If this is an update for our own avatar give it the highest priority 224 if (entity == null)
225 if (presence == entity) 225 return double.NaN;
226 return 0.0;
227 226
228 // Use group position for child prims 227 // Use group position for child prims
229 Vector3 entityPos = entity.AbsolutePosition; 228 Vector3 entityPos = entity.AbsolutePosition;
230 if (entity is SceneObjectPart) 229 if (entity is SceneObjectPart)
231 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 230 {
231 SceneObjectGroup group = (entity as SceneObjectPart).ParentGroup;
232 if (group != null)
233 entityPos = group.AbsolutePosition;
232 else 234 else
233 entityPos = entity.AbsolutePosition; 235 entityPos = entity.AbsolutePosition;
236 }
237 else
238 entityPos = entity.AbsolutePosition;
234 239
240 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
241 if (presence != null)
242 {
235 if (!presence.IsChildAgent) 243 if (!presence.IsChildAgent)
236 { 244 {
237 if (entity is ScenePresence) 245 if (entity is ScenePresence)