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 34461dc..5796194 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 {
@@ -906,8 +921,12 @@ namespace OpenSim.Region.Framework.Scenes
906 public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID) 921 public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
907 { 922 {
908 SceneObjectPart part = GetSceneObjectPart(localID); 923 SceneObjectPart part = GetSceneObjectPart(localID);
909 SceneObjectGroup group = part.ParentGroup; 924 SceneObjectGroup group = null;
910 if (group != null) 925 if (part != null)
926 {
927 group = part.ParentGroup;
928 }
929 if (part != null && group != null)
911 { 930 {
912 TaskInventoryItem item = group.GetInventoryItem(localID, itemID); 931 TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
913 if (item == null) 932 if (item == null)
@@ -1336,7 +1355,7 @@ namespace OpenSim.Region.Framework.Scenes
1336 } 1355 }
1337 if (part.Inventory.UpdateInventoryItem(itemInfo)) 1356 if (part.Inventory.UpdateInventoryItem(itemInfo))
1338 { 1357 {
1339 remoteClient.SendAgentAlertMessage("Notecard saved", false); 1358 // remoteClient.SendAgentAlertMessage("Notecard saved", false);
1340 part.GetProperties(remoteClient); 1359 part.GetProperties(remoteClient);
1341 } 1360 }
1342 } 1361 }
@@ -1429,7 +1448,7 @@ namespace OpenSim.Region.Framework.Scenes
1429 return; 1448 return;
1430 1449
1431 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, 1450 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
1432 Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"), 1451 Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"),
1433 remoteClient.AgentId); 1452 remoteClient.AgentId);
1434 AssetService.Store(asset); 1453 AssetService.Store(asset);
1435 1454
@@ -1655,15 +1674,21 @@ namespace OpenSim.Region.Framework.Scenes
1655 } 1674 }
1656 else 1675 else
1657 { 1676 {
1658 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) 1677 if (action == DeRezAction.TakeCopy)
1678 {
1679 if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
1680 permissionToTakeCopy = false;
1681 }
1682 else
1683 {
1659 permissionToTakeCopy = false; 1684 permissionToTakeCopy = false;
1685 }
1660 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) 1686 if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
1661 permissionToTake = false; 1687 permissionToTake = false;
1662 1688
1663 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) 1689 if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
1664 permissionToDelete = false; 1690 permissionToDelete = false;
1665 } 1691 }
1666
1667 } 1692 }
1668 1693
1669 // Handle god perms 1694 // Handle god perms