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.cs49
1 files changed, 16 insertions, 33 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index addc20c..4700c3b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -225,16 +225,8 @@ namespace OpenSim.Region.Framework.Scenes
225 SceneObjectPart part = GetSceneObjectPart(primId); 225 SceneObjectPart part = GetSceneObjectPart(primId);
226 if (part == null) 226 if (part == null)
227 return new ArrayList(); 227 return new ArrayList();
228 SceneObjectGroup group = part.ParentGroup;
229 if (null == group)
230 {
231 m_log.ErrorFormat(
232 "[PRIM INVENTORY]: " +
233 "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
234 itemId, primId);
235 228
236 return new ArrayList(); 229 SceneObjectGroup group = part.ParentGroup;
237 }
238 230
239 // Retrieve item 231 // Retrieve item
240 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); 232 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId);
@@ -971,33 +963,23 @@ namespace OpenSim.Region.Framework.Scenes
971 SceneObjectPart part = GetSceneObjectPart(localID); 963 SceneObjectPart part = GetSceneObjectPart(localID);
972 if (part == null) 964 if (part == null)
973 return; 965 return;
966
974 SceneObjectGroup group = part.ParentGroup; 967 SceneObjectGroup group = part.ParentGroup;
975 if (group != null) 968 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
976 { 969 return;
977 if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) 970
978 return; 971 TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
979 972 if (item == null)
980 TaskInventoryItem item = group.GetInventoryItem(localID, itemID); 973 return;
981 if (item == null)
982 return;
983 974
984 if (item.Type == 10) 975 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 { 976 {
995 m_log.ErrorFormat( 977 part.RemoveScriptEvents(itemID);
996 "[PRIM INVENTORY]: " + 978 EventManager.TriggerRemoveScript(localID, itemID);
997 "Removal of item {0} requested of prim {1} but this prim does not exist",
998 itemID,
999 localID);
1000 } 979 }
980
981 group.RemoveInventoryItem(localID, itemID);
982 part.GetProperties(remoteClient);
1001 } 983 }
1002 984
1003 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId) 985 private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId)
@@ -1770,7 +1752,7 @@ namespace OpenSim.Region.Framework.Scenes
1770 continue; 1752 continue;
1771 1753
1772 // Already deleted by someone else 1754 // Already deleted by someone else
1773 if (part.ParentGroup == null || part.ParentGroup.IsDeleted) 1755 if (part.ParentGroup.IsDeleted)
1774 continue; 1756 continue;
1775 1757
1776 // Can't delete child prims 1758 // Can't delete child prims
@@ -2034,6 +2016,7 @@ namespace OpenSim.Region.Framework.Scenes
2034 SceneObjectPart part = GetSceneObjectPart(localID); 2016 SceneObjectPart part = GetSceneObjectPart(localID);
2035 if (part == null) 2017 if (part == null)
2036 continue; 2018 continue;
2019
2037 if (!groups.Contains(part.ParentGroup)) 2020 if (!groups.Contains(part.ParentGroup))
2038 groups.Add(part.ParentGroup); 2021 groups.Add(part.ParentGroup);
2039 } 2022 }