aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-26 00:10:37 +0000
committerJustin Clark-Casey (justincc)2012-01-26 00:10:37 +0000
commit55c6cbabfd04599030548983f376f60acdf607e7 (patch)
treeacb78bec49b2b92beaf4bb8bfa691c0e43308f52 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-55c6cbabfd04599030548983f376f60acdf607e7.zip
opensim-SC-55c6cbabfd04599030548983f376f60acdf607e7.tar.gz
opensim-SC-55c6cbabfd04599030548983f376f60acdf607e7.tar.bz2
opensim-SC-55c6cbabfd04599030548983f376f60acdf607e7.tar.xz
refactor: change RezScriptFromAgentInventory(), RezNewScript() and AddInventoryItem() to accept an agent id rather than a full IClientAPI.
This stops some code having to make spurious client == null checks and reduces regression test complexity.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs15
1 files changed, 4 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index 905ecc9..f173c95 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -83,13 +83,12 @@ namespace OpenSim.Region.Framework.Scenes
83 /// <summary> 83 /// <summary>
84 /// Add an inventory item from a user's inventory to a prim in this scene object. 84 /// Add an inventory item from a user's inventory to a prim in this scene object.
85 /// </summary> 85 /// </summary>
86 /// <param name="remoteClient">The client adding the item.</param> 86 /// <param name="agentID">The agent adding the item.</param>
87 /// <param name="localID">The local ID of the part receiving the add.</param> 87 /// <param name="localID">The local ID of the part receiving the add.</param>
88 /// <param name="item">The user inventory item being added.</param> 88 /// <param name="item">The user inventory item being added.</param>
89 /// <param name="copyItemID">The item UUID that should be used by the new item.</param> 89 /// <param name="copyItemID">The item UUID that should be used by the new item.</param>
90 /// <returns></returns> 90 /// <returns></returns>
91 public bool AddInventoryItem(IClientAPI remoteClient, uint localID, 91 public bool AddInventoryItem(UUID agentID, uint localID, InventoryItemBase item, UUID copyItemID)
92 InventoryItemBase item, UUID copyItemID)
93 { 92 {
94// m_log.DebugFormat( 93// m_log.DebugFormat(
95// "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}", 94// "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}",
@@ -111,9 +110,7 @@ namespace OpenSim.Region.Framework.Scenes
111 taskItem.Type = item.AssetType; 110 taskItem.Type = item.AssetType;
112 taskItem.InvType = item.InvType; 111 taskItem.InvType = item.InvType;
113 112
114 if (remoteClient != null && 113 if (agentID != part.OwnerID && m_scene.Permissions.PropagatePermissions())
115 remoteClient.AgentId != part.OwnerID &&
116 m_scene.Permissions.PropagatePermissions())
117 { 114 {
118 taskItem.BasePermissions = item.BasePermissions & 115 taskItem.BasePermissions = item.BasePermissions &
119 item.NextPermissions; 116 item.NextPermissions;
@@ -148,11 +145,7 @@ namespace OpenSim.Region.Framework.Scenes
148// taskItem.SaleType = item.SaleType; 145// taskItem.SaleType = item.SaleType;
149 taskItem.CreationDate = (uint)item.CreationDate; 146 taskItem.CreationDate = (uint)item.CreationDate;
150 147
151 bool addFromAllowedDrop = false; 148 bool addFromAllowedDrop = agentID != part.OwnerID;
152 if (remoteClient != null)
153 {
154 addFromAllowedDrop = remoteClient.AgentId != part.OwnerID;
155 }
156 149
157 part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop); 150 part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop);
158 151