diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 37 |
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 | } |