diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index de3c360..505d01f 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -122,9 +122,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
122 | // Use group position for child prims | 122 | // Use group position for child prims |
123 | Vector3 entityPos; | 123 | Vector3 entityPos; |
124 | if (entity is SceneObjectPart) | 124 | if (entity is SceneObjectPart) |
125 | entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; | 125 | { |
126 | // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene | ||
127 | // before its scheduled update was triggered | ||
128 | //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; | ||
129 | entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; | ||
130 | } | ||
126 | else | 131 | else |
132 | { | ||
127 | entityPos = entity.AbsolutePosition; | 133 | entityPos = entity.AbsolutePosition; |
134 | } | ||
128 | 135 | ||
129 | return Vector3.DistanceSquared(presencePos, entityPos); | 136 | return Vector3.DistanceSquared(presencePos, entityPos); |
130 | } | 137 | } |
@@ -144,9 +151,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
144 | // Use group position for child prims | 151 | // Use group position for child prims |
145 | Vector3 entityPos = entity.AbsolutePosition; | 152 | Vector3 entityPos = entity.AbsolutePosition; |
146 | if (entity is SceneObjectPart) | 153 | if (entity is SceneObjectPart) |
147 | entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; | 154 | { |
155 | // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene | ||
156 | // before its scheduled update was triggered | ||
157 | //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; | ||
158 | entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; | ||
159 | } | ||
148 | else | 160 | else |
161 | { | ||
149 | entityPos = entity.AbsolutePosition; | 162 | entityPos = entity.AbsolutePosition; |
163 | } | ||
150 | 164 | ||
151 | if (!presence.IsChildAgent) | 165 | if (!presence.IsChildAgent) |
152 | { | 166 | { |