From 6826ca9b57e8582722efe3f9626148b2e52ef160 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 19 Jan 2017 18:25:25 +0000 Subject: [PATCH] fix the meaning of objectDuplicate[OnRay]() flags parameter but still not using it --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 6 +++--- .../World/Land/Tests/PrimCountModuleTests.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 10 +++++++--- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 2 +- .../Region/Framework/Scenes/Tests/SceneGraphTests.cs | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 7455dea689..410ac0052b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -7758,10 +7758,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP ObjectDuplicate handlerObjectDuplicate = null; - for (int i = 0; i < dupe.ObjectData.Length; i++) + handlerObjectDuplicate = OnObjectDuplicate; + if (handlerObjectDuplicate != null) { - handlerObjectDuplicate = OnObjectDuplicate; - if (handlerObjectDuplicate != null) + for (int i = 0; i < dupe.ObjectData.Length; i++) { UUID rezGroupID = dupe.AgentData.GroupID; if(!IsGroupMember(rezGroupID)) diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index 0d8ece7cdf..a349aa1be5 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs @@ -151,7 +151,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); m_scene.AddNewSceneObject(sog, false); - m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); + m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, m_userId, UUID.Zero, Quaternion.Identity, false); Assert.That(pc.Owner, Is.EqualTo(6)); Assert.That(pc.Group, Is.EqualTo(0)); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ff1e34e78a..d9b0327911 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3605,7 +3605,9 @@ namespace OpenSim.Region.Framework.Scenes /// Group of new object public void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) { - SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); + bool createSelected = (flags & (uint)PrimFlags.CreateSelected) != 0; + SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, AgentID, + GroupID, Quaternion.Identity, createSelected); if (copy != null) EventManager.TriggerObjectAddedToScene(copy); } @@ -3635,6 +3637,8 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart target = GetSceneObjectPart(localID); SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj); + bool createSelected = (dupeFlags & (uint)PrimFlags.CreateSelected) != 0; + if (target != null && target2 != null) { Vector3 direction = Vector3.Normalize(RayEnd - RayStart); @@ -3676,13 +3680,13 @@ namespace OpenSim.Region.Framework.Scenes Quaternion worldRot = target2.GetWorldRotation(); // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); - copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); + copy = m_sceneGraph.DuplicateObject(localID, pos, AgentID, GroupID, worldRot, createSelected); //obj.Rotation = worldRot; //obj.UpdateGroupRotationR(worldRot); } else { - copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, Quaternion.Identity); + copy = m_sceneGraph.DuplicateObject(localID, pos, AgentID, GroupID, Quaternion.Identity, createSelected); } if (copy != null) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 6a369821af..ebf081e69c 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -2057,7 +2057,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// null if duplication fails, otherwise the duplicated object /// - public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) + public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, UUID AgentID, UUID GroupID, Quaternion rot, bool createSelected) { // m_log.DebugFormat( // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 56723bfd95..4d2eb3fe89 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectGroup dupeSo = scene.SceneGraph.DuplicateObject( - part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); + part1.LocalId, new Vector3(10, 0, 0), ownerId, UUID.Zero, Quaternion.Identity, false); Assert.That(dupeSo.Parts.Length, Is.EqualTo(2)); SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1);