Fix a problem where SceneGraph.AddSceneObject() would return false on successfully adding an object rather than true, in defiance of its method documentation

This meant that the returns were inconsistent - false would be returned both for various scene object failure conditions (e.g. root part was null) and if the object was successfully added.
soprefactor
Justin Clark-Casey (justincc) 2010-05-21 21:22:53 +01:00
parent 721c1085da
commit f83acf533b
2 changed files with 14 additions and 8 deletions

View File

@ -243,7 +243,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// to the same scene (when this is possible). // to the same scene (when this is possible).
sceneObject.ResetIDs(); sceneObject.ResetIDs();
foreach (SceneObjectPart part in sceneObject.Children.Values) foreach (SceneObjectPart part in sceneObject.Children.Values)
{ {
if (!ResolveUserUuid(part.CreatorID)) if (!ResolveUserUuid(part.CreatorID))

View File

@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes
if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero)
return false; return false;
bool alreadyExisted = false; bool newlyAdded = false;
if (m_parentScene.m_clampPrimSize) if (m_parentScene.m_clampPrimSize)
{ {
@ -306,6 +306,11 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (!Entities.ContainsKey(sceneObject.UUID)) if (!Entities.ContainsKey(sceneObject.UUID))
{ {
// m_log.DebugFormat(
// "[SCENE GRAPH]: Adding object {0} {1} to region {2}",
// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
newlyAdded = true;
Entities.Add(sceneObject); Entities.Add(sceneObject);
m_numPrim += sceneObject.Children.Count; m_numPrim += sceneObject.Children.Count;
@ -326,13 +331,15 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
else // else
{ // {
alreadyExisted = true; // m_log.WarnFormat(
} // "[SCENE GRAPH]: Scene object {0} {1} was already in region {2} on add request",
// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
// }
} }
return alreadyExisted; return newlyAdded;
} }
/// <summary> /// <summary>