From f83acf533b708d7963c5dd1238709898a969c96c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 May 2010 21:22:53 +0100 Subject: 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. --- .../World/Archiver/ArchiveReadRequest.cs | 1 - OpenSim/Region/Framework/Scenes/SceneGraph.cs | 21 ++++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 8d62fe1..f97ae5f 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -243,7 +243,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver // to the same scene (when this is possible). sceneObject.ResetIDs(); - foreach (SceneObjectPart part in sceneObject.Children.Values) { if (!ResolveUserUuid(part.CreatorID)) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index ef13c98..bb570e7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) return false; - bool alreadyExisted = false; + bool newlyAdded = false; if (m_parentScene.m_clampPrimSize) { @@ -305,7 +305,12 @@ namespace OpenSim.Region.Framework.Scenes lock (sceneObject) { 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); m_numPrim += sceneObject.Children.Count; @@ -326,13 +331,15 @@ namespace OpenSim.Region.Framework.Scenes } } } - else - { - alreadyExisted = true; - } +// else +// { +// 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; } /// -- cgit v1.1