aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs43
2 files changed, 26 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 2b90960..fd43923 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -161,6 +161,7 @@ namespace OpenSim.Region.Framework.Interfaces
161 /// in this prim's inventory.</param> 161 /// in this prim's inventory.</param>
162 /// <returns>false if the item did not exist, true if the update occurred successfully</returns> 162 /// <returns>false if the item did not exist, true if the update occurred successfully</returns>
163 bool UpdateInventoryItem(TaskInventoryItem item); 163 bool UpdateInventoryItem(TaskInventoryItem item);
164 bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents);
164 165
165 /// <summary> 166 /// <summary>
166 /// Remove an item from this entity's inventory 167 /// 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 3b1b567..44c49c5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -609,30 +609,37 @@ namespace OpenSim.Region.Framework.Scenes
609 /// <returns>false if the item did not exist, true if the update occurred successfully</returns> 609 /// <returns>false if the item did not exist, true if the update occurred successfully</returns>
610 public bool UpdateInventoryItem(TaskInventoryItem item) 610 public bool UpdateInventoryItem(TaskInventoryItem item)
611 { 611 {
612 lock (m_items) 612 return UpdateInventoryItem(item, true);
613 }
614
615 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
616 {
617 lock(m_items)
613 { 618 {
614 if (m_items.ContainsKey(item.ItemID)) 619 if (m_items.ContainsKey(item.ItemID))
615 { 620 {
616 item.ParentID = m_part.UUID; 621 if (m_items.ContainsKey(item.ItemID))
617 item.ParentPartID = m_part.UUID;
618 item.Flags = m_items[item.ItemID].Flags;
619
620 // If group permissions have been set on, check that the groupID is up to date in case it has
621 // changed since permissions were last set.
622 if (item.GroupPermissions != (uint)PermissionMask.None)
623 item.GroupID = m_part.GroupID;
624
625 if (item.AssetID == UUID.Zero)
626 { 622 {
627 item.AssetID = m_items[item.ItemID].AssetID; 623 item.ParentID = m_part.UUID;
628 } 624 item.ParentPartID = m_part.UUID;
629 625 item.Flags = m_items[item.ItemID].Flags;
626
627 // If group permissions have been set on, check that the groupID is up to date in case it has
628 // changed since permissions were last set.
629 if (item.GroupPermissions != (uint)PermissionMask.None)
630 item.GroupID = m_part.GroupID;
631
632 if (item.AssetID == UUID.Zero)
633 {
634 item.AssetID = m_items[item.ItemID].AssetID;
635 }
630 m_items[item.ItemID] = item; 636 m_items[item.ItemID] = item;
631 m_inventorySerial++; 637 m_inventorySerial++;
632 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 638 if (fireScriptEvents)
639 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
633 HasInventoryChanged = true; 640 HasInventoryChanged = true;
634 m_part.ParentGroup.HasGroupChanged = true; 641 m_part.ParentGroup.HasGroupChanged = true;
635 642 m_items.LockItemsForWrite(false);
636 return true; 643 return true;
637 } 644 }
638 else 645 else
@@ -643,9 +650,9 @@ namespace OpenSim.Region.Framework.Scenes
643 item.ItemID, m_part.Name, m_part.UUID, 650 item.ItemID, m_part.Name, m_part.UUID,
644 m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); 651 m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
645 } 652 }
646 }
647 653
648 return false; 654 return false;
655 }
649 } 656 }
650 657
651 /// <summary> 658 /// <summary>