aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 501f199..073bccf 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,11 @@ 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
344 if (allowedDrop)
345 TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
346 else
347 TriggerScriptChangedEvent(Changed.INVENTORY);
341 } 348 }
342 349
343 m_inventorySerial++; 350 m_inventorySerial++;