aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-09-07 03:41:29 +0100
committerJustin Clark-Casey (justincc)2010-09-07 03:41:29 +0100
commitf7b28dd32155eac2d55ccf0757b059794d6b5f67 (patch)
treedaba1307fa62acc66a74fb15ca621e32ed24c98b /OpenSim/Region
parentminor: comment out some excessive test logging (diff)
downloadopensim-SC-f7b28dd32155eac2d55ccf0757b059794d6b5f67.zip
opensim-SC-f7b28dd32155eac2d55ccf0757b059794d6b5f67.tar.gz
opensim-SC-f7b28dd32155eac2d55ccf0757b059794d6b5f67.tar.bz2
opensim-SC-f7b28dd32155eac2d55ccf0757b059794d6b5f67.tar.xz
If a scene object part UUID is changed (only possible when not in a scene), then adjust the inventory items to point to the new uuid as well
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs3
3 files changed, 12 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
index 58698ee..32b3724 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs
@@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
215 public void TestLoadOarV0_2() 215 public void TestLoadOarV0_2()
216 { 216 {
217 TestHelper.InMethod(); 217 TestHelper.InMethod();
218 //log4net.Config.XmlConfigurator.Configure(); 218// log4net.Config.XmlConfigurator.Configure();
219 219
220 MemoryStream archiveWriteStream = new MemoryStream(); 220 MemoryStream archiveWriteStream = new MemoryStream();
221 TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); 221 TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 3ed74e1..3753dcb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -494,7 +494,14 @@ namespace OpenSim.Region.Framework.Scenes
494 public UUID UUID 494 public UUID UUID
495 { 495 {
496 get { return m_uuid; } 496 get { return m_uuid; }
497 set { m_uuid = value; } 497 set
498 {
499 m_uuid = value;
500
501 // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part
502 if (Inventory != null)
503 Inventory.ResetInventoryIDs();
504 }
498 } 505 }
499 506
500 public uint LocalId 507 public uint LocalId
@@ -2756,7 +2763,6 @@ namespace OpenSim.Region.Framework.Scenes
2756 UUID = UUID.Random(); 2763 UUID = UUID.Random();
2757 LinkNum = linkNum; 2764 LinkNum = linkNum;
2758 LocalId = 0; 2765 LocalId = 0;
2759 Inventory.ResetInventoryIDs();
2760 } 2766 }
2761 2767
2762 /// <summary> 2768 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index ca089a1..87c4860 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -119,6 +119,9 @@ namespace OpenSim.Region.Framework.Scenes
119 /// <param name="linkNum">Link number for the part</param> 119 /// <param name="linkNum">Link number for the part</param>
120 public void ResetInventoryIDs() 120 public void ResetInventoryIDs()
121 { 121 {
122 if (null == m_part || null == m_part.ParentGroup)
123 return;
124
122 lock (m_items) 125 lock (m_items)
123 { 126 {
124 if (0 == m_items.Count) 127 if (0 == m_items.Count)