mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* 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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user