diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Prioritizer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 3a3ec2b..c75f8ba 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -1,3 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
1 | using System; | 28 | using System; |
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using log4net; | 30 | using log4net; |
@@ -35,7 +62,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
35 | 62 | ||
36 | /// <summary> | 63 | /// <summary> |
37 | /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the | 64 | /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the |
38 | /// viewer before child prim updates. | 65 | /// viewer before child prim updates. |
39 | /// The adjustment is added to child prims and subtracted from root prims, so the gap ends up | 66 | /// The adjustment is added to child prims and subtracted from root prims, so the gap ends up |
40 | /// being double. We do it both ways so that there is a still a priority delta even if the priority is already | 67 | /// being double. We do it both ways so that there is a still a priority delta even if the priority is already |
41 | /// double.MinValue or double.MaxValue. | 68 | /// double.MinValue or double.MaxValue. |
@@ -123,9 +150,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
123 | if (entity is SceneObjectPart) | 150 | if (entity is SceneObjectPart) |
124 | { | 151 | { |
125 | // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene | 152 | // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene |
126 | // before its scheduled update was triggered | 153 | // before its scheduled update was triggered |
127 | //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; | 154 | //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; |
128 | entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; | 155 | entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; |
129 | } | 156 | } |
130 | else | 157 | else |
131 | { | 158 | { |
@@ -152,15 +179,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
152 | Vector3 entityPos = entity.AbsolutePosition; | 179 | Vector3 entityPos = entity.AbsolutePosition; |
153 | if (entity is SceneObjectPart) | 180 | if (entity is SceneObjectPart) |
154 | { | 181 | { |
155 | SceneObjectGroup group = m_scene.GetGroupByPrim(entity.LocalId); | 182 | // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene |
156 | if (group == null) | 183 | // before its scheduled update was triggered |
157 | { | 184 | //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; |
158 | entityPos = entity.AbsolutePosition; | 185 | entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; |
159 | } | ||
160 | else | ||
161 | { | ||
162 | entityPos = group.AbsolutePosition; | ||
163 | } | ||
164 | } | 186 | } |
165 | else | 187 | else |
166 | { | 188 | { |