diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index f555b49f58..11a0146f09 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs @@ -104,14 +104,8 @@ namespace OpenSim.Region.Framework.Scenes // better than losing the object for now. if (permissionToDelete) { - List killIDs = new List(); - foreach (SceneObjectGroup g in objectGroups) - { killIDs.Add(g.LocalId); - g.DeleteGroupFromScene(true); - } - - m_scene.SendKillObject(killIDs); + g.DeleteGroupFromScene(false); } } @@ -160,7 +154,7 @@ namespace OpenSim.Region.Framework.Scenes if (x.permissionToDelete) { foreach (SceneObjectGroup g in x.objectGroups) - m_scene.DeleteSceneObject(g, false); + m_scene.DeleteSceneObject(g, true); } } catch (Exception e) diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs index f738ff188e..d670dad654 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectDeRezTests.cs @@ -84,30 +84,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests TestScene scene = new SceneHelpers().SetupScene(); SceneHelpers.SetupSceneModules(scene, new PermissionsModule()); - IClientAPI client = SceneHelpers.AddScenePresence(scene, userId).ControllingClient; + TestClient client = (TestClient)SceneHelpers.AddScenePresence(scene, userId).ControllingClient; // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; sogd.Enabled = false; - - SceneObjectPart part - = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); - part.Name = "obj1"; - scene.AddNewSceneObject(new SceneObjectGroup(part), false); + + SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, "so1", userId); + uint soLocalId = so.LocalId; List localIds = new List(); - localIds.Add(part.LocalId); + localIds.Add(so.LocalId); scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); // Check that object isn't deleted until we crank the sogd handle. - SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(so.LocalId); Assert.That(retrievedPart, Is.Not.Null); Assert.That(retrievedPart.ParentGroup.IsDeleted, Is.False); sogd.InventoryDeQueueAndDelete(); - SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(so.LocalId); Assert.That(retrievedPart2, Is.Null); + + Assert.That(client.ReceivedKills.Count, Is.EqualTo(1)); + Assert.That(client.ReceivedKills[0], Is.EqualTo(soLocalId)); } ///