Add a parameter to prim inventory update to prevent event firing
parent
81ff5eaba0
commit
06661708b4
|
@ -163,6 +163,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// in this prim's inventory.</param>
|
/// in this prim's inventory.</param>
|
||||||
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
|
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
|
||||||
bool UpdateInventoryItem(TaskInventoryItem item);
|
bool UpdateInventoryItem(TaskInventoryItem item);
|
||||||
|
bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove an item from this entity's inventory
|
/// Remove an item from this entity's inventory
|
||||||
|
|
|
@ -734,6 +734,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// in this prim's inventory.</param>
|
/// in this prim's inventory.</param>
|
||||||
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
|
/// <returns>false if the item did not exist, true if the update occurred successfully</returns>
|
||||||
public bool UpdateInventoryItem(TaskInventoryItem item)
|
public bool UpdateInventoryItem(TaskInventoryItem item)
|
||||||
|
{
|
||||||
|
return UpdateInventoryItem(item, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
|
||||||
{
|
{
|
||||||
m_items.LockItemsForWrite(true);
|
m_items.LockItemsForWrite(true);
|
||||||
|
|
||||||
|
@ -765,7 +770,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
m_items[item.ItemID] = item;
|
m_items[item.ItemID] = item;
|
||||||
m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
if (fireScriptEvents)
|
||||||
|
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
m_items.LockItemsForWrite(false);
|
m_items.LockItemsForWrite(false);
|
||||||
|
|
Loading…
Reference in New Issue