aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs45
1 files changed, 19 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index dbefb4a..89f3683 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -211,16 +211,10 @@ namespace OpenSim.Region.Framework.Scenes
211 211
212 // Retrieve group 212 // Retrieve group
213 SceneObjectPart part = GetSceneObjectPart(primId); 213 SceneObjectPart part = GetSceneObjectPart(primId);
214 SceneObjectGroup group = part.ParentGroup; 214 if (part == null)
215 if (null == group)
216 {
217 m_log.ErrorFormat(
218 "[PRIM INVENTORY]: " +
219 "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
220 itemId, primId);
221
222 return new ArrayList(); 215 return new ArrayList();
223 } 216
217 SceneObjectGroup group = part.ParentGroup;
224 218
225 // Retrieve item 219 // Retrieve item
226 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); 220 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId);
@@ -709,7 +703,10 @@ namespace OpenSim.Region.Framework.Scenes
709 newName = item.Name; 703 newName = item.Name;
710 } 704 }
711 705
712 if (remoteClient.AgentId == oldAgentID || (LibraryService != null && LibraryService.LibraryRootFolder != null && oldAgentID == LibraryService.LibraryRootFolder.Owner)) 706 if (remoteClient.AgentId == oldAgentID
707 || (LibraryService != null
708 && LibraryService.LibraryRootFolder != null
709 && oldAgentID == LibraryService.LibraryRootFolder.Owner))
713 { 710 {
714 CreateNewInventoryItem( 711 CreateNewInventoryItem(
715 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, 712 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType,
@@ -981,23 +978,14 @@ namespace OpenSim.Region.Framework.Scenes
981 if (item == null) 978 if (item == null)
982 return; 979 return;
983 980
984 if (item.Type == 10) 981 if (item.Type == 10)
985 {
986 part.RemoveScriptEvents(itemID);
987 EventManager.TriggerRemoveScript(localID, itemID);
988 }
989
990 group.RemoveInventoryItem(localID, itemID);
991 part.GetProperties(remoteClient);
992 }
993 else
994 { 982 {
995 m_log.ErrorFormat( 983 part.RemoveScriptEvents(itemID);
996 "[PRIM INVENTORY]: " + 984 EventManager.TriggerRemoveScript(localID, itemID);
997 "Removal of item {0} requested of prim {1} but this prim does not exist",
998 itemID,
999 localID);
1000 } 985 }
986
987 group.RemoveInventoryItem(localID, itemID);
988 part.GetProperties(remoteClient);
1001 } 989 }
1002 990
1003 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId) 991 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId)
@@ -1780,7 +1768,7 @@ namespace OpenSim.Region.Framework.Scenes
1780 } 1768 }
1781 1769
1782 // Already deleted by someone else 1770 // Already deleted by someone else
1783 if (part.ParentGroup == null || part.ParentGroup.IsDeleted) 1771 if (part.ParentGroup.IsDeleted)
1784 { 1772 {
1785 //Client still thinks the object exists, kill it 1773 //Client still thinks the object exists, kill it
1786 deleteIDs.Add(localID); 1774 deleteIDs.Add(localID);
@@ -2158,6 +2146,9 @@ namespace OpenSim.Region.Framework.Scenes
2158 foreach (uint localID in localIDs) 2146 foreach (uint localID in localIDs)
2159 { 2147 {
2160 SceneObjectPart part = GetSceneObjectPart(localID); 2148 SceneObjectPart part = GetSceneObjectPart(localID);
2149 if (part == null)
2150 continue;
2151
2161 if (!groups.Contains(part.ParentGroup)) 2152 if (!groups.Contains(part.ParentGroup))
2162 groups.Add(part.ParentGroup); 2153 groups.Add(part.ParentGroup);
2163 } 2154 }
@@ -2203,6 +2194,8 @@ namespace OpenSim.Region.Framework.Scenes
2203 foreach (uint localID in localIDs) 2194 foreach (uint localID in localIDs)
2204 { 2195 {
2205 SceneObjectPart part = GetSceneObjectPart(localID); 2196 SceneObjectPart part = GetSceneObjectPart(localID);
2197 if (part == null)
2198 continue;
2206 part.GetProperties(remoteClient); 2199 part.GetProperties(remoteClient);
2207 } 2200 }
2208 } 2201 }