aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs18
1 files changed, 12 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 501f199..fa66515 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -289,16 +289,16 @@ namespace OpenSim.Region.Environment.Scenes
289 /// name is chosen. 289 /// name is chosen.
290 /// </summary> 290 /// </summary>
291 /// <param name="item"></param> 291 /// <param name="item"></param>
292 public void AddInventoryItem(TaskInventoryItem item) 292 public void AddInventoryItem(TaskInventoryItem item, bool allowedDrop)
293 { 293 {
294 AddInventoryItem(item.Name, item); 294 AddInventoryItem(item.Name, item, allowedDrop);
295 } 295 }
296 296
297 /// <summary> 297 /// <summary>
298 /// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced. 298 /// Add an item to this prim's inventory. If an item with the same name already exists, it is replaced.
299 /// </summary> 299 /// </summary>
300 /// <param name="item"></param> 300 /// <param name="item"></param>
301 public void AddInventoryItemExclusive(TaskInventoryItem item) 301 public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
302 { 302 {
303 List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_taskInventory.Values); 303 List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_taskInventory.Values);
304 foreach (TaskInventoryItem i in il) 304 foreach (TaskInventoryItem i in il)
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes
313 } 313 }
314 } 314 }
315 315
316 AddInventoryItem(item.Name, item); 316 AddInventoryItem(item.Name, item, allowedDrop);
317 } 317 }
318 318
319 /// <summary> 319 /// <summary>
@@ -324,7 +324,10 @@ namespace OpenSim.Region.Environment.Scenes
324 /// The item itself. The name within this structure is ignored in favour of the name 324 /// The item itself. The name within this structure is ignored in favour of the name
325 /// given in this method's arguments 325 /// given in this method's arguments
326 /// </param> 326 /// </param>
327 protected void AddInventoryItem(string name, TaskInventoryItem item) 327 /// <param name="allowedDrop">
328 // Item was only added to inventory because AllowedDrop is set
329 /// </param>
330 protected void AddInventoryItem(string name, TaskInventoryItem item, bool allowedDrop)
328 { 331 {
329 name = FindAvailableInventoryName(name); 332 name = FindAvailableInventoryName(name);
330 if (name == String.Empty) 333 if (name == String.Empty)
@@ -337,7 +340,10 @@ namespace OpenSim.Region.Environment.Scenes
337 lock (m_taskInventory) 340 lock (m_taskInventory)
338 { 341 {
339 m_taskInventory.Add(item.ItemID, item); 342 m_taskInventory.Add(item.ItemID, item);
340 TriggerScriptChangedEvent(Changed.INVENTORY); 343 if (allowedDrop)
344 TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
345 else
346 TriggerScriptChangedEvent(Changed.INVENTORY);
341 } 347 }
342 348
343 m_inventorySerial++; 349 m_inventorySerial++;