aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs36
1 files changed, 23 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 54ac792..20b3b5c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -297,34 +297,44 @@ namespace OpenSim.Region.Framework.Scenes
297 297
298 sceneObject.AttachToScene(m_parentScene); 298 sceneObject.AttachToScene(m_parentScene);
299 299
300 List<SceneObjectPart> parts = null;
301 bool found = false;
300 lock (sceneObject) 302 lock (sceneObject)
301 { 303 {
302 if (!Entities.ContainsKey(sceneObject.UUID)) 304 if (!Entities.ContainsKey(sceneObject.UUID))
303 { 305 {
306 found = true;
304 Entities.Add(sceneObject); 307 Entities.Add(sceneObject);
305 m_numPrim += sceneObject.Children.Count; 308 m_numPrim += sceneObject.Children.Count;
306 309
307 if (attachToBackup) 310 if (attachToBackup)
308 sceneObject.AttachToBackup(); 311 sceneObject.AttachToBackup();
309 312
310 if (OnObjectCreate != null) 313 parts = new List<SceneObjectPart>(sceneObject.Children.Values);
311 OnObjectCreate(sceneObject); 314
312 315 }
313 lock (m_dictionary_lock) 316 }
317
318 if (found)
319 {
320 lock (m_dictionary_lock)
321 {
322 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
323 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
324 foreach (SceneObjectPart part in parts)
314 { 325 {
315 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 326 SceneObjectGroupsByFullID[part.UUID] = sceneObject;
316 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; 327 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
317 foreach (SceneObjectPart part in sceneObject.Children.Values)
318 {
319 SceneObjectGroupsByFullID[part.UUID] = sceneObject;
320 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
321 }
322 } 328 }
323
324 return true;
325 } 329 }
330
331 if (OnObjectCreate != null)
332 OnObjectCreate(sceneObject);
333
334 return true;
326 } 335 }
327 336
337
328 return false; 338 return false;
329 } 339 }
330 340