diff options
author | meta7 | 2010-08-12 05:40:41 -0700 |
---|---|---|
committer | meta7 | 2010-08-12 05:40:41 -0700 |
commit | b43a731beb24dccf273aefc0e601841ea59b6fd4 (patch) | |
tree | 2e5ca4eb17e2139a40eaa52dc689f704b550ba1f /OpenSim/Region/Framework/Scenes/Prioritizer.cs | |
parent | Add ini.example section for the MOTD module. (diff) | |
download | opensim-SC_OLD-b43a731beb24dccf273aefc0e601841ea59b6fd4.zip opensim-SC_OLD-b43a731beb24dccf273aefc0e601841ea59b6fd4.tar.gz opensim-SC_OLD-b43a731beb24dccf273aefc0e601841ea59b6fd4.tar.bz2 opensim-SC_OLD-b43a731beb24dccf273aefc0e601841ea59b6fd4.tar.xz |
Fix a nullref exception in the prioritizer
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 13 |
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 | ||