Add a parameter to prim inventory update to prevent event firing

avinationmerge
Melanie Thielker 2010-04-27 02:40:30 +02:00
parent 81ff5eaba0
commit 06661708b4
2 changed files with 8 additions and 1 deletions

View File

@ -163,6 +163,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// in this prim's inventory.</param>
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
bool UpdateInventoryItem(TaskInventoryItem item);
bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents);
/// <summary>
/// Remove an item from this entity's inventory

View File

@ -734,6 +734,11 @@ namespace OpenSim.Region.Framework.Scenes
/// in this prim's inventory.</param>
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
public bool UpdateInventoryItem(TaskInventoryItem item)
{
return UpdateInventoryItem(item, true);
}
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
{
m_items.LockItemsForWrite(true);
@ -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);