diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Prioritizer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 145f9ed..3a3ec2b 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -31,7 +31,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
31 | 31 | ||
32 | public class Prioritizer | 32 | public class Prioritizer |
33 | { | 33 | { |
34 | private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 34 | // private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
35 | 35 | ||
36 | /// <summary> | 36 | /// <summary> |
37 | /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the | 37 | /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the |
@@ -75,7 +75,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
75 | break; | 75 | break; |
76 | default: | 76 | default: |
77 | throw new InvalidOperationException("UpdatePrioritizationScheme not defined."); | 77 | throw new InvalidOperationException("UpdatePrioritizationScheme not defined."); |
78 | break; | ||
79 | } | 78 | } |
80 | 79 | ||
81 | // Adjust priority so that root prims are sent to the viewer first. This is especially important for | 80 | // Adjust priority so that root prims are sent to the viewer first. This is especially important for |
@@ -122,9 +121,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
122 | // Use group position for child prims | 121 | // Use group position for child prims |
123 | Vector3 entityPos; | 122 | Vector3 entityPos; |
124 | if (entity is SceneObjectPart) | 123 | if (entity is SceneObjectPart) |
125 | entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; | 124 | { |
125 | // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene | ||
126 | // before its scheduled update was triggered | ||
127 | //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; | ||
128 | entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; | ||
129 | } | ||
126 | else | 130 | else |
131 | { | ||
127 | entityPos = entity.AbsolutePosition; | 132 | entityPos = entity.AbsolutePosition; |
133 | } | ||
128 | 134 | ||
129 | return Vector3.DistanceSquared(presencePos, entityPos); | 135 | return Vector3.DistanceSquared(presencePos, entityPos); |
130 | } | 136 | } |
@@ -157,7 +163,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
157 | } | 163 | } |
158 | } | 164 | } |
159 | else | 165 | else |
166 | { | ||
160 | entityPos = entity.AbsolutePosition; | 167 | entityPos = entity.AbsolutePosition; |
168 | } | ||
161 | 169 | ||
162 | if (!presence.IsChildAgent) | 170 | if (!presence.IsChildAgent) |
163 | { | 171 | { |