diff options
author | Melanie | 2010-04-27 00:25:29 +0100 |
---|---|---|
committer | Melanie | 2010-04-27 00:25:29 +0100 |
commit | 6928ec024060bb7181553206c9ee6a125e7c9a2d (patch) | |
tree | 6583fdfb28c89a7be2c16784078d8023388add4f | |
parent | Better error message. (diff) | |
download | opensim-SC-6928ec024060bb7181553206c9ee6a125e7c9a2d.zip opensim-SC-6928ec024060bb7181553206c9ee6a125e7c9a2d.tar.gz opensim-SC-6928ec024060bb7181553206c9ee6a125e7c9a2d.tar.bz2 opensim-SC-6928ec024060bb7181553206c9ee6a125e7c9a2d.tar.xz |
Add a parameter to prim inventory update to prevent event firing
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 43 |
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> |