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 | |
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')
4 files changed, 40 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 6289f7a..59ce090 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -58,6 +58,15 @@ namespace OpenSim.Region.Framework.Interfaces | |||
58 | void ResetInventoryIDs(); | 58 | void ResetInventoryIDs(); |
59 | 59 | ||
60 | /// <summary> | 60 | /// <summary> |
61 | /// Reset parent object UUID for all the items in the prim's inventory. | ||
62 | /// </summary> | ||
63 | /// | ||
64 | /// If this method is called and there are inventory items, then we regard the inventory as having changed. | ||
65 | /// | ||
66 | /// <param name="linkNum">Link number for the part</param> | ||
67 | void ResetObjectID(); | ||
68 | |||
69 | /// <summary> | ||
61 | /// Change every item in this inventory to a new owner. | 70 | /// Change every item in this inventory to a new owner. |
62 | /// </summary> | 71 | /// </summary> |
63 | /// <param name="ownerId"></param> | 72 | /// <param name="ownerId"></param> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 142f5d8..ab9cbd7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -696,6 +696,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
696 | if (node.Attributes["UUID"] != null) | 696 | if (node.Attributes["UUID"] != null) |
697 | { | 697 | { |
698 | UUID itemid = new UUID(node.Attributes["UUID"].Value); | 698 | UUID itemid = new UUID(node.Attributes["UUID"].Value); |
699 | m_log.DebugFormat("[SCRIPT STATE]: Adding state for oldID {0}", itemid); | ||
699 | m_savedScriptState.Add(itemid, node.InnerXml); | 700 | m_savedScriptState.Add(itemid, node.InnerXml); |
700 | } | 701 | } |
701 | } | 702 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 5c4a2a3..40112c9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -514,7 +514,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
514 | 514 | ||
515 | // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part | 515 | // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part |
516 | if (Inventory != null) | 516 | if (Inventory != null) |
517 | Inventory.ResetInventoryIDs(); | 517 | Inventory.ResetObjectID(); |
518 | } | 518 | } |
519 | } | 519 | } |
520 | 520 | ||
@@ -2800,6 +2800,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2800 | UUID = UUID.Random(); | 2800 | UUID = UUID.Random(); |
2801 | LinkNum = linkNum; | 2801 | LinkNum = linkNum; |
2802 | LocalId = 0; | 2802 | LocalId = 0; |
2803 | Inventory.ResetInventoryIDs(); | ||
2803 | } | 2804 | } |
2804 | 2805 | ||
2805 | /// <summary> | 2806 | /// <summary> |
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> |