diff options
author | root | 2010-09-16 23:12:32 +0200 |
---|---|---|
committer | root | 2010-09-16 23:12:32 +0200 |
commit | a0c87b5af6bba104fe50de3006b5dd515a8eb833 (patch) | |
tree | e0d3e1aef1f7f249da324bd5d480b3894359bbf7 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |
parent | Catch a nullref (diff) | |
download | opensim-SC-a0c87b5af6bba104fe50de3006b5dd515a8eb833.zip opensim-SC-a0c87b5af6bba104fe50de3006b5dd515a8eb833.tar.gz opensim-SC-a0c87b5af6bba104fe50de3006b5dd515a8eb833.tar.bz2 opensim-SC-a0c87b5af6bba104fe50de3006b5dd515a8eb833.tar.xz |
JustinCC is evil. f7b28dd3 broke script persistence. This fixes it.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index a9a5c8a..b205503 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -148,6 +148,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
148 | m_items.LockItemsForWrite(false); | 148 | m_items.LockItemsForWrite(false); |
149 | } | 149 | } |
150 | 150 | ||
151 | public void ResetObjectID() | ||
152 | { | ||
153 | m_items.LockItemsForWrite(true); | ||
154 | |||
155 | if (Items.Count == 0) | ||
156 | { | ||
157 | m_items.LockItemsForWrite(false); | ||
158 | return; | ||
159 | } | ||
160 | |||
161 | HasInventoryChanged = true; | ||
162 | if (m_part.ParentGroup != null) | ||
163 | { | ||
164 | m_part.ParentGroup.HasGroupChanged = true; | ||
165 | } | ||
166 | |||
167 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); | ||
168 | Items.Clear(); | ||
169 | |||
170 | foreach (TaskInventoryItem item in items) | ||
171 | { | ||
172 | item.ParentPartID = m_part.UUID; | ||
173 | item.ParentID = m_part.UUID; | ||
174 | Items.Add(item.ItemID, item); | ||
175 | } | ||
176 | m_items.LockItemsForWrite(false); | ||
177 | } | ||
178 | |||
151 | /// <summary> | 179 | /// <summary> |
152 | /// Change every item in this inventory to a new owner. | 180 | /// Change every item in this inventory to a new owner. |
153 | /// </summary> | 181 | /// </summary> |