From 96ecb62197dbb5fef9f6c1855e032ac855b94e5f Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Tue, 1 Apr 2008 17:06:33 +0000
Subject: * Fix for mantis #678 * Shift copied prims should now keep the script
 in both prims over region startups

---
 OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs       |  5 ++++-
 .../Region/Environment/Scenes/SceneObjectPart.Inventory.cs  | 13 +++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

(limited to 'OpenSim/Region/Environment/Scenes')

diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index edb76e9..eb7ad33 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -386,6 +386,9 @@ namespace OpenSim.Region.Environment.Scenes
             UpdateParentIDs();
         }
 
+        /// <summary>
+        /// Hooks this object up to the backup event so that it is persisted to the database when the update thread executes.
+        /// </summary>
         private void AttachToBackup()
         {
             if (InSceneBackup)
@@ -550,7 +553,7 @@ namespace OpenSim.Region.Environment.Scenes
         #region Copying
 
         /// <summary>
-        /// 
+        /// Duplicates this object, including operations such as physics set up and attaching to the backup event.
         /// </summary>
         /// <returns></returns>
         public SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index f7e82a5..56894b7 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -90,13 +90,22 @@ namespace OpenSim.Region.Environment.Scenes
 
         /// <summary>
         /// Reset LLUUIDs for all the items in the prim's inventory.  This involves either generating
-        /// new ones or setting existing UUIDs to the correct parent UUIDs
+        /// new ones or setting existing UUIDs to the correct parent UUIDs.
+        /// 
+        /// If this method is called and there are inventory items, then we regard the inventory as having changed.
         /// </summary>
         /// <param name="linkNum">Link number for the part</param>
         public void ResetInventoryIDs()
         {
             lock (TaskInventory)
-            {
+            {                         
+                if (0 == TaskInventory.Count)
+                {
+                    return;                    
+                }
+                
+                HasInventoryChanged = true;                
+                
                 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(TaskInventory.Values);
                 TaskInventory.Clear();
 
-- 
cgit v1.1