From 69bcbd856b8785b2912fa4ceac7411967756107c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 19 Jan 2017 19:01:56 +0000 Subject: change CanDuplicateObject --- OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 11 ++++++++--- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index a7f3dd7..3e75c8a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp); public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp); - public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); + public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp, Scene scenen); public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID, Scene scene); public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp); public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); @@ -392,15 +392,20 @@ namespace OpenSim.Region.Framework.Scenes #endregion #region DUPLICATE OBJECT - public bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Vector3 objectPosition) + public bool CanDuplicateObject(SceneObjectGroup sog, UUID agentID) { DuplicateObjectHandler handler = OnDuplicateObject; if (handler != null) { + if(sog == null || sog.IsDeleted) + return false; + ScenePresence sp = m_scene.GetScenePresence(agentID); + if(sp == null || sp.IsDeleted) + return false; Delegate[] list = handler.GetInvocationList(); foreach (DuplicateObjectHandler h in list) { - if (h(objectCount, objectID, owner, m_scene, objectPosition) == false) + if (h(sog, sp, m_scene) == false) return false; } } diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index fc13692..9264138 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -2066,8 +2066,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectGroup original = GetGroupByPrim(originalPrimID); if (original != null) { - if (m_parentScene.Permissions.CanDuplicateObject( - original.PrimCount, original.UUID, AgentID, original.AbsolutePosition)) + if (m_parentScene.Permissions.CanDuplicateObject(original, AgentID)) { SceneObjectGroup copy = original.Copy(true); copy.AbsolutePosition = copy.AbsolutePosition + offset; -- cgit v1.1