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, 33 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 750b1f7..55c1575 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -94,6 +94,22 @@ namespace OpenSim.Region.Framework.Scenes
94 94
95 public void AddInventoryItem(UUID AgentID, InventoryItemBase item) 95 public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
96 { 96 {
97 InventoryFolderBase folder;
98
99 if (item.Folder == UUID.Zero)
100 {
101 folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType);
102 if (folder == null)
103 {
104 folder = InventoryService.GetRootFolder(AgentID);
105
106 if (folder == null)
107 return;
108 }
109
110 item.Folder = folder.ID;
111 }
112
97 if (InventoryService.AddItem(item)) 113 if (InventoryService.AddItem(item))
98 { 114 {
99 int userlevel = 0; 115 int userlevel = 0;
@@ -214,8 +230,7 @@ namespace OpenSim.Region.Framework.Scenes
214 { 230 {
215 // Needs to determine which engine was running it and use that 231 // Needs to determine which engine was running it and use that
216 // 232 //
217 part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0); 233 errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
218 errors = part.Inventory.GetScriptErrors(item.ItemID);
219 } 234 }
220 else 235 else
221 { 236 {
@@ -836,8 +851,12 @@ namespace OpenSim.Region.Framework.Scenes
836 public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID) 851 public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
837 { 852 {
838 SceneObjectPart part = GetSceneObjectPart(localID); 853 SceneObjectPart part = GetSceneObjectPart(localID);
839 SceneObjectGroup group = part.ParentGroup; 854 SceneObjectGroup group = null;
840 if (group != null) 855 if (part != null)
856 {
857 group = part.ParentGroup;
858 }
859 if (part != null && group != null)
841 { 860 {
842 TaskInventoryItem item = group.GetInventoryItem(localID, itemID); 861 TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
843 if (item == null) 862 if (item == null)
@@ -1572,19 +1591,21 @@ namespace OpenSim.Region.Framework.Scenes
1572 // So that we know the database is upto date, 1591 // So that we know the database is upto date,
1573 // for when deleting the object from it 1592 // for when deleting the object from it
1574 ForceSceneObjectBackup(grp); 1593 ForceSceneObjectBackup(grp);
1594 if (remoteClient != null)
1595 {
1596 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
1597 permissionToTakeCopy = false;
1598 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
1599 permissionToTake = false;
1575 1600
1576 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) 1601 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
1577 permissionToTakeCopy = false; 1602 permissionToDelete = false;
1578 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
1579 permissionToTake = false;
1580
1581 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
1582 permissionToDelete = false;
1583 1603
1604 }
1584 } 1605 }
1585 1606
1586 // Handle god perms 1607 // Handle god perms
1587 if (Permissions.IsGod(remoteClient.AgentId)) 1608 if (remoteClient != null && Permissions.IsGod(remoteClient.AgentId))
1588 { 1609 {
1589 permissionToTake = true; 1610 permissionToTake = true;
1590 permissionToTakeCopy = true; 1611 permissionToTakeCopy = true;