aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorroot2010-09-16 23:12:32 +0200
committerMelanie2010-09-16 23:19:46 +0100
commit1b2edfe75f4fe8b320f65ad54f6f2b0972fda154 (patch)
tree7985e5df6f02fc475a84d451e2a3fe2d35b0494e
parentAdd the modules include line back that i dropped by mistake (diff)
downloadopensim-SC_OLD-1b2edfe75f4fe8b320f65ad54f6f2b0972fda154.zip
opensim-SC_OLD-1b2edfe75f4fe8b320f65ad54f6f2b0972fda154.tar.gz
opensim-SC_OLD-1b2edfe75f4fe8b320f65ad54f6f2b0972fda154.tar.bz2
opensim-SC_OLD-1b2edfe75f4fe8b320f65ad54f6f2b0972fda154.tar.xz
JustinCC is evil. f7b28dd3 broke script persistence. This fixes it.
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs28
4 files changed, 40 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 7edb43e..2e6faa0 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 f9a8d41..833c9d3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -511,6 +511,7 @@ namespace OpenSim.Region.Framework.Scenes
511 if (node.Attributes["UUID"] != null) 511 if (node.Attributes["UUID"] != null)
512 { 512 {
513 UUID itemid = new UUID(node.Attributes["UUID"].Value); 513 UUID itemid = new UUID(node.Attributes["UUID"].Value);
514 m_log.DebugFormat("[SCRIPT STATE]: Adding state for oldID {0}", itemid);
514 m_savedScriptState.Add(itemid, node.InnerXml); 515 m_savedScriptState.Add(itemid, node.InnerXml);
515 } 516 }
516 } 517 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 024bdc9..95cd26f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -500,7 +500,7 @@ namespace OpenSim.Region.Framework.Scenes
500 500
501 // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part 501 // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part
502 if (Inventory != null) 502 if (Inventory != null)
503 Inventory.ResetInventoryIDs(); 503 Inventory.ResetObjectID();
504 } 504 }
505 } 505 }
506 506
@@ -2763,6 +2763,7 @@ namespace OpenSim.Region.Framework.Scenes
2763 UUID = UUID.Random(); 2763 UUID = UUID.Random();
2764 LinkNum = linkNum; 2764 LinkNum = linkNum;
2765 LocalId = 0; 2765 LocalId = 0;
2766 Inventory.ResetInventoryIDs();
2766 } 2767 }
2767 2768
2768 /// <summary> 2769 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 53ddb5d..fbaa7d4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -140,6 +140,34 @@ namespace OpenSim.Region.Framework.Scenes
140 } 140 }
141 } 141 }
142 142
143 public void ResetObjectID()
144 {
145 m_items.LockItemsForWrite(true);
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 {
164 item.ParentPartID = m_part.UUID;
165 item.ParentID = m_part.UUID;
166 Items.Add(item.ItemID, item);
167 }
168 m_items.LockItemsForWrite(false);
169 }
170
143 /// <summary> 171 /// <summary>
144 /// Change every item in this inventory to a new owner. 172 /// Change every item in this inventory to a new owner.
145 /// </summary> 173 /// </summary>