aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs43
1 files changed, 21 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index fbaa7d4..7ba30fc 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -142,30 +142,29 @@ namespace OpenSim.Region.Framework.Scenes
142 142
143 public void ResetObjectID() 143 public void ResetObjectID()
144 { 144 {
145 m_items.LockItemsForWrite(true); 145 lock (Items)
146
147 if (Items.Count == 0)
148 {
149 m_items.LockItemsForWrite(false);
150 return;
151 }
152
153 HasInventoryChanged = true;
154 if (m_part.ParentGroup != null)
155 {
156 m_part.ParentGroup.HasGroupChanged = true;
157 }
158
159 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
160 Items.Clear();
161
162 foreach (TaskInventoryItem item in items)
163 { 146 {
164 item.ParentPartID = m_part.UUID; 147 if (Items.Count == 0)
165 item.ParentID = m_part.UUID; 148 {
166 Items.Add(item.ItemID, item); 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);
159 Items.Clear();
160
161 foreach (TaskInventoryItem item in items)
162 {
163 item.ParentPartID = m_part.UUID;
164 item.ParentID = m_part.UUID;
165 Items.Add(item.ItemID, item);
166 }
167 } 167 }
168 m_items.LockItemsForWrite(false);
169 } 168 }
170 169
171 /// <summary> 170 /// <summary>