diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 93 |
1 files changed, 48 insertions, 45 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 3c2203c..d4658ec 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -307,61 +307,64 @@ namespace OpenSim.Region.Framework.Scenes | |||
307 | if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) | 307 | if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) |
308 | return false; | 308 | return false; |
309 | 309 | ||
310 | bool alreadyExisted = false; | 310 | lock (sceneObject) |
311 | 311 | { | |
312 | if (m_parentScene.m_clampPrimSize) | 312 | if (Entities.ContainsKey(sceneObject.UUID)) |
313 | { | ||
314 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
315 | { | 313 | { |
316 | Vector3 scale = part.Shape.Scale; | 314 | // m_log.WarnFormat( |
317 | 315 | // "[SCENE GRAPH]: Scene object {0} {1} was already in region {2} on add request", | |
318 | if (scale.X > m_parentScene.m_maxNonphys) | 316 | // sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName); |
319 | scale.X = m_parentScene.m_maxNonphys; | 317 | return false; |
320 | if (scale.Y > m_parentScene.m_maxNonphys) | ||
321 | scale.Y = m_parentScene.m_maxNonphys; | ||
322 | if (scale.Z > m_parentScene.m_maxNonphys) | ||
323 | scale.Z = m_parentScene.m_maxNonphys; | ||
324 | |||
325 | part.Shape.Scale = scale; | ||
326 | } | 318 | } |
327 | } | 319 | |
328 | 320 | // m_log.DebugFormat( | |
329 | sceneObject.AttachToScene(m_parentScene); | 321 | // "[SCENE GRAPH]: Adding object {0} {1} to region {2}", |
330 | 322 | // sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName); | |
331 | if (sendClientUpdates) | 323 | |
332 | sceneObject.ScheduleGroupForFullUpdate(); | 324 | if (m_parentScene.m_clampPrimSize) |
333 | |||
334 | lock (sceneObject) | ||
335 | { | ||
336 | if (!Entities.ContainsKey(sceneObject.UUID)) | ||
337 | { | 325 | { |
338 | Entities.Add(sceneObject); | 326 | foreach (SceneObjectPart part in sceneObject.Children.Values) |
339 | m_numPrim += sceneObject.Children.Count; | ||
340 | |||
341 | if (attachToBackup) | ||
342 | sceneObject.AttachToBackup(); | ||
343 | |||
344 | if (OnObjectCreate != null) | ||
345 | OnObjectCreate(sceneObject); | ||
346 | |||
347 | lock (m_dictionary_lock) | ||
348 | { | 327 | { |
349 | SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; | 328 | Vector3 scale = part.Shape.Scale; |
350 | SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; | 329 | |
351 | foreach (SceneObjectPart part in sceneObject.Children.Values) | 330 | if (scale.X > m_parentScene.m_maxNonphys) |
352 | { | 331 | scale.X = m_parentScene.m_maxNonphys; |
353 | SceneObjectGroupsByFullID[part.UUID] = sceneObject; | 332 | if (scale.Y > m_parentScene.m_maxNonphys) |
354 | SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; | 333 | scale.Y = m_parentScene.m_maxNonphys; |
355 | } | 334 | if (scale.Z > m_parentScene.m_maxNonphys) |
335 | scale.Z = m_parentScene.m_maxNonphys; | ||
336 | |||
337 | part.Shape.Scale = scale; | ||
356 | } | 338 | } |
357 | } | 339 | } |
358 | else | 340 | |
341 | sceneObject.AttachToScene(m_parentScene); | ||
342 | |||
343 | if (sendClientUpdates) | ||
344 | sceneObject.ScheduleGroupForFullUpdate(); | ||
345 | |||
346 | Entities.Add(sceneObject); | ||
347 | m_numPrim += sceneObject.Children.Count; | ||
348 | |||
349 | if (attachToBackup) | ||
350 | sceneObject.AttachToBackup(); | ||
351 | |||
352 | if (OnObjectCreate != null) | ||
353 | OnObjectCreate(sceneObject); | ||
354 | |||
355 | lock (m_dictionary_lock) | ||
359 | { | 356 | { |
360 | alreadyExisted = true; | 357 | SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; |
358 | SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; | ||
359 | foreach (SceneObjectPart part in sceneObject.Children.Values) | ||
360 | { | ||
361 | SceneObjectGroupsByFullID[part.UUID] = sceneObject; | ||
362 | SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; | ||
363 | } | ||
361 | } | 364 | } |
362 | } | 365 | } |
363 | 366 | ||
364 | return alreadyExisted; | 367 | return true; |
365 | } | 368 | } |
366 | 369 | ||
367 | /// <summary> | 370 | /// <summary> |