aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff options
context:
space:
mode:
authorMelanie2010-11-16 20:44:39 +0100
committerMelanie2010-11-16 20:44:39 +0100
commit4f15b8d4e6be1e1fe88ad32aa43595861d1005ad (patch)
tree5c6dd29543347ea43c2a46658a451b355fdbf528 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
parentCan't detach an object from within the script thread because it will throw. (diff)
downloadopensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.zip
opensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.tar.gz
opensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.tar.bz2
opensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.tar.xz
Change the way attachments are persisted. Editing a worn attachment will now
save properly, as will the results of a resizer script working. Attachment positions are no longer saved on each move, but instead are saved once on logout. Attachment script states are saved as part of the attachment now when detaching.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs37
1 files changed, 20 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 522f75e..8fcfcc5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -131,12 +131,6 @@ namespace OpenSim.Region.Framework.Scenes
131 return; 131 return;
132 } 132 }
133 133
134 HasInventoryChanged = true;
135 if (m_part.ParentGroup != null)
136 {
137 m_part.ParentGroup.HasGroupChanged = true;
138 }
139
140 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); 134 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
141 Items.Clear(); 135 Items.Clear();
142 136
@@ -158,12 +152,6 @@ namespace OpenSim.Region.Framework.Scenes
158 return; 152 return;
159 } 153 }
160 154
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); 155 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
168 Items.Clear(); 156 Items.Clear();
169 157
@@ -216,8 +204,15 @@ namespace OpenSim.Region.Framework.Scenes
216 return; 204 return;
217 } 205 }
218 206
219 HasInventoryChanged = true; 207 // Don't let this set the HasGroupChanged flag for attachments
220 m_part.ParentGroup.HasGroupChanged = true; 208 // as this happens during rez and we don't want a new asset
209 // for each attachment each time
210 if (!m_part.ParentGroup.RootPart.IsAttachment)
211 {
212 HasInventoryChanged = true;
213 m_part.ParentGroup.HasGroupChanged = true;
214 }
215
221 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values); 216 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
222 foreach (TaskInventoryItem item in items) 217 foreach (TaskInventoryItem item in items)
223 { 218 {
@@ -824,11 +819,16 @@ namespace OpenSim.Region.Framework.Scenes
824 /// <returns>false if the item did not exist, true if the update occurred successfully</returns> 819 /// <returns>false if the item did not exist, true if the update occurred successfully</returns>
825 public bool UpdateInventoryItem(TaskInventoryItem item) 820 public bool UpdateInventoryItem(TaskInventoryItem item)
826 { 821 {
827 return UpdateInventoryItem(item, true); 822 return UpdateInventoryItem(item, true, true);
828 } 823 }
829 824
830 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents) 825 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
831 { 826 {
827 return UpdateInventoryItem(item, fireScriptEvents, true);
828 }
829
830 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents, bool considerChanged)
831 {
832 m_items.LockItemsForWrite(true); 832 m_items.LockItemsForWrite(true);
833 833
834 if (m_items.ContainsKey(item.ItemID)) 834 if (m_items.ContainsKey(item.ItemID))
@@ -849,8 +849,11 @@ namespace OpenSim.Region.Framework.Scenes
849 m_inventorySerial++; 849 m_inventorySerial++;
850 if (fireScriptEvents) 850 if (fireScriptEvents)
851 m_part.TriggerScriptChangedEvent(Changed.INVENTORY); 851 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
852 HasInventoryChanged = true; 852 if (considerChanged)
853 m_part.ParentGroup.HasGroupChanged = true; 853 {
854 HasInventoryChanged = true;
855 m_part.ParentGroup.HasGroupChanged = true;
856 }
854 m_items.LockItemsForWrite(false); 857 m_items.LockItemsForWrite(false);
855 return true; 858 return true;
856 } 859 }