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.cs41
1 files changed, 33 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 9ba13ae..38a5456 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)
@@ -1266,7 +1285,7 @@ namespace OpenSim.Region.Framework.Scenes
1266 } 1285 }
1267 if (part.Inventory.UpdateInventoryItem(itemInfo)) 1286 if (part.Inventory.UpdateInventoryItem(itemInfo))
1268 { 1287 {
1269 remoteClient.SendAgentAlertMessage("Notecard saved", false); 1288 // remoteClient.SendAgentAlertMessage("Notecard saved", false);
1270 part.GetProperties(remoteClient); 1289 part.GetProperties(remoteClient);
1271 } 1290 }
1272 } 1291 }
@@ -1359,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes
1359 return; 1378 return;
1360 1379
1361 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, 1380 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
1362 Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"), 1381 Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"),
1363 remoteClient.AgentId); 1382 remoteClient.AgentId);
1364 AssetService.Store(asset); 1383 AssetService.Store(asset);
1365 1384
@@ -1585,15 +1604,21 @@ namespace OpenSim.Region.Framework.Scenes
1585 } 1604 }
1586 else 1605 else
1587 { 1606 {
1588 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) 1607 if (action == DeRezAction.TakeCopy)
1608 {
1609 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
1610 permissionToTakeCopy = false;
1611 }
1612 else
1613 {
1589 permissionToTakeCopy = false; 1614 permissionToTakeCopy = false;
1615 }
1590 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) 1616 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
1591 permissionToTake = false; 1617 permissionToTake = false;
1592 1618
1593 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) 1619 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
1594 permissionToDelete = false; 1620 permissionToDelete = false;
1595 } 1621 }
1596
1597 } 1622 }
1598 1623
1599 // Handle god perms 1624 // Handle god perms