* Refactor: Move the responsibility for applying physics and sending the initial client update to Scene.AddSceneObject() from some of the SceneObjectGroup constructors

* I think this has been done cleanly from inspection and testing, but if prim creation or load suddenly starts playing up more than usual, please open a mantis
* This also has the effect of stopping the archiver generating ghost in-world prims
* Some code dupliction also removed
This commit is contained in:
Justin Clarke Casey
2008-06-17 20:36:21 +00:00
parent 33d32355a1
commit 16d0a895cb
6 changed files with 16 additions and 52 deletions

View File

@@ -197,15 +197,16 @@ namespace OpenSim.Region.Environment.Scenes
foreach (SceneObjectPart part in sceneObject.Children.Values)
{
part.LocalId = m_parentScene.PrimIDAllocate();
}
sceneObject.UpdateParentIDs();
AddSceneObject(sceneObject, true);
}
/// <summary>
/// Add an object to the scene.
/// Add an object to the scene. This will both update the scene, and send information about the
/// new object to all clients interested in the scene.
/// </summary>
/// <param name="sceneObject"></param>
/// <param name="attachToBackup">
@@ -216,6 +217,9 @@ namespace OpenSim.Region.Environment.Scenes
/// </returns>
protected internal bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
{
sceneObject.ApplyPhysics(m_parentScene.m_physicalPrim);
sceneObject.ScheduleGroupForFullUpdate();
lock (Entities)
{
if (!Entities.ContainsKey(sceneObject.UUID))