From 06661708b4b2ed33116839ced93d43ca0f0909a0 Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Tue, 27 Apr 2010 02:40:30 +0200
Subject: Add a parameter to prim inventory update to prevent event firing
---
OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | 1 +
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index d893890..1e2f60b 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -163,6 +163,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// in this prim's inventory.
/// false if the item did not exist, true if the update occurred successfully
bool UpdateInventoryItem(TaskInventoryItem item);
+ bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents);
///
/// Remove an item from this entity's inventory
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index f875224..bc3225a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -735,6 +735,11 @@ namespace OpenSim.Region.Framework.Scenes
/// false if the item did not exist, true if the update occurred successfully
public bool UpdateInventoryItem(TaskInventoryItem item)
{
+ return UpdateInventoryItem(item, true);
+ }
+
+ public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
+ {
m_items.LockItemsForWrite(true);
if (m_items.ContainsKey(item.ItemID))
@@ -765,7 +770,8 @@ namespace OpenSim.Region.Framework.Scenes
m_items[item.ItemID] = item;
m_inventorySerial++;
- m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
+ if (fireScriptEvents)
+ m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
m_items.LockItemsForWrite(false);
--
cgit v1.1