aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 8cd0160..c6db7af 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -134,6 +134,7 @@ namespace OpenSim.Region.Framework.Scenes
134 134
135 private double GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) 135 private double GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity)
136 { 136 {
137 if (entity == null) return double.NaN;
137 ScenePresence presence = m_scene.GetScenePresence(client.AgentId); 138 ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
138 if (presence != null) 139 if (presence != null)
139 { 140 {
@@ -144,7 +145,17 @@ namespace OpenSim.Region.Framework.Scenes
144 // Use group position for child prims 145 // Use group position for child prims
145 Vector3 entityPos = entity.AbsolutePosition; 146 Vector3 entityPos = entity.AbsolutePosition;
146 if (entity is SceneObjectPart) 147 if (entity is SceneObjectPart)
147 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 148 {
149 SceneObjectGroup group = m_scene.GetGroupByPrim(entity.LocalId);
150 if (group == null)
151 {
152 entityPos = entity.AbsolutePosition;
153 }
154 else
155 {
156 entityPos = group.AbsolutePosition;
157 }
158 }
148 else 159 else
149 entityPos = entity.AbsolutePosition; 160 entityPos = entity.AbsolutePosition;
150 161