diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | 11 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 |
2 files changed, 9 insertions, 5 deletions
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 | |||
47 | public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 47 | public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
48 | public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); | 48 | public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); |
49 | public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 49 | public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
50 | public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); | 50 | public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp, Scene scenen); |
51 | public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID, Scene scene); | 51 | public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID, Scene scene); |
52 | public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp); | 52 | public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
53 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); | 53 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); |
@@ -392,15 +392,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
392 | #endregion | 392 | #endregion |
393 | 393 | ||
394 | #region DUPLICATE OBJECT | 394 | #region DUPLICATE OBJECT |
395 | public bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Vector3 objectPosition) | 395 | public bool CanDuplicateObject(SceneObjectGroup sog, UUID agentID) |
396 | { | 396 | { |
397 | DuplicateObjectHandler handler = OnDuplicateObject; | 397 | DuplicateObjectHandler handler = OnDuplicateObject; |
398 | if (handler != null) | 398 | if (handler != null) |
399 | { | 399 | { |
400 | if(sog == null || sog.IsDeleted) | ||
401 | return false; | ||
402 | ScenePresence sp = m_scene.GetScenePresence(agentID); | ||
403 | if(sp == null || sp.IsDeleted) | ||
404 | return false; | ||
400 | Delegate[] list = handler.GetInvocationList(); | 405 | Delegate[] list = handler.GetInvocationList(); |
401 | foreach (DuplicateObjectHandler h in list) | 406 | foreach (DuplicateObjectHandler h in list) |
402 | { | 407 | { |
403 | if (h(objectCount, objectID, owner, m_scene, objectPosition) == false) | 408 | if (h(sog, sp, m_scene) == false) |
404 | return false; | 409 | return false; |
405 | } | 410 | } |
406 | } | 411 | } |
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 | |||
2066 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); | 2066 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); |
2067 | if (original != null) | 2067 | if (original != null) |
2068 | { | 2068 | { |
2069 | if (m_parentScene.Permissions.CanDuplicateObject( | 2069 | if (m_parentScene.Permissions.CanDuplicateObject(original, AgentID)) |
2070 | original.PrimCount, original.UUID, AgentID, original.AbsolutePosition)) | ||
2071 | { | 2070 | { |
2072 | SceneObjectGroup copy = original.Copy(true); | 2071 | SceneObjectGroup copy = original.Copy(true); |
2073 | copy.AbsolutePosition = copy.AbsolutePosition + offset; | 2072 | copy.AbsolutePosition = copy.AbsolutePosition + offset; |