aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs40
1 files changed, 21 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 0c5e62d..6a204c3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -127,8 +127,6 @@ namespace OpenSim.Region.Framework.Scenes
127 if (0 == m_items.Count) 127 if (0 == m_items.Count)
128 return; 128 return;
129 129
130 HasInventoryChanged = true;
131 m_part.ParentGroup.HasGroupChanged = true;
132 IList<TaskInventoryItem> items = GetInventoryItems(); 130 IList<TaskInventoryItem> items = GetInventoryItems();
133 m_items.Clear(); 131 m_items.Clear();
134 132
@@ -144,17 +142,6 @@ namespace OpenSim.Region.Framework.Scenes
144 { 142 {
145 lock (Items) 143 lock (Items)
146 { 144 {
147 if (Items.Count == 0)
148 {
149 return;
150 }
151
152 HasInventoryChanged = true;
153 if (m_part.ParentGroup != null)
154 {
155 m_part.ParentGroup.HasGroupChanged = true;
156 }
157
158 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); 145 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
159 Items.Clear(); 146 Items.Clear();
160 147
@@ -208,8 +195,15 @@ namespace OpenSim.Region.Framework.Scenes
208 } 195 }
209 } 196 }
210 197
211 HasInventoryChanged = true; 198 // Don't let this set the HasGroupChanged flag for attachments
212 m_part.ParentGroup.HasGroupChanged = true; 199 // as this happens during rez and we don't want a new asset
200 // for each attachment each time
201 if (!m_part.ParentGroup.RootPart.IsAttachment)
202 {
203 HasInventoryChanged = true;
204 m_part.ParentGroup.HasGroupChanged = true;
205 }
206
213 List<TaskInventoryItem> items = GetInventoryItems(); 207 List<TaskInventoryItem> items = GetInventoryItems();
214 foreach (TaskInventoryItem item in items) 208 foreach (TaskInventoryItem item in items)
215 { 209 {
@@ -674,13 +668,19 @@ namespace OpenSim.Region.Framework.Scenes
674 /// <returns>false if the item did not exist, true if the update occurred successfully</returns> 668 /// <returns>false if the item did not exist, true if the update occurred successfully</returns>
675 public bool UpdateInventoryItem(TaskInventoryItem item) 669 public bool UpdateInventoryItem(TaskInventoryItem item)
676 { 670 {
677 return UpdateInventoryItem(item, true); 671 return UpdateInventoryItem(item, true, true);
678 } 672 }
679 673
680 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents) 674 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
681 { 675 {
676 return UpdateInventoryItem(item, fireScriptEvents, true);
677 }
678
679 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents, bool considerChanged)
680 {
682 TaskInventoryItem it = GetInventoryItem(item.ItemID); 681 TaskInventoryItem it = GetInventoryItem(item.ItemID);
683 if (it != null) 682 if (it != null)
683
684 { 684 {
685 item.ParentID = m_part.UUID; 685 item.ParentID = m_part.UUID;
686 item.ParentPartID = m_part.UUID; 686 item.ParentPartID = m_part.UUID;
@@ -702,9 +702,11 @@ namespace OpenSim.Region.Framework.Scenes
702 702
703 if (fireScriptEvents) 703 if (fireScriptEvents)
704 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 704 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
705 705 if (considerChanged)
706 HasInventoryChanged = true; 706 {
707 m_part.ParentGroup.HasGroupChanged = true; 707 HasInventoryChanged = true;
708 m_part.ParentGroup.HasGroupChanged = true;
709 }
708 return true; 710 return true;
709 } 711 }
710 else 712 else