diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 4130029..a9e1fc2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -684,12 +684,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
684 | itemCopy.SalePrice = item.SalePrice; | 684 | itemCopy.SalePrice = item.SalePrice; |
685 | itemCopy.SaleType = item.SaleType; | 685 | itemCopy.SaleType = item.SaleType; |
686 | 686 | ||
687 | if (AddInventoryItem(itemCopy)) | 687 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); |
688 | { | 688 | if (invAccess != null) |
689 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | 689 | invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); |
690 | if (invAccess != null) | 690 | AddInventoryItem(itemCopy); |
691 | Util.FireAndForget(delegate { invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); }); | ||
692 | } | ||
693 | 691 | ||
694 | if (!Permissions.BypassPermissions()) | 692 | if (!Permissions.BypassPermissions()) |
695 | { | 693 | { |
@@ -1786,6 +1784,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1786 | /// <returns>The part where the script was rezzed if successful. False otherwise.</returns> | 1784 | /// <returns>The part where the script was rezzed if successful. False otherwise.</returns> |
1787 | public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase) | 1785 | public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase) |
1788 | { | 1786 | { |
1787 | return RezNewScript( | ||
1788 | agentID, | ||
1789 | itemBase, | ||
1790 | "default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"); | ||
1791 | } | ||
1792 | |||
1793 | /// <summary> | ||
1794 | /// Rez a new script from nothing with given script text. | ||
1795 | /// </summary> | ||
1796 | /// <param name="remoteClient"></param> | ||
1797 | /// <param name="itemBase">Template item.</param> | ||
1798 | /// <param name="scriptText"></param> | ||
1799 | /// <returns>The part where the script was rezzed if successful. False otherwise.</returns> | ||
1800 | public SceneObjectPart RezNewScript(UUID agentID, InventoryItemBase itemBase, string scriptText) | ||
1801 | { | ||
1789 | // The part ID is the folder ID! | 1802 | // The part ID is the folder ID! |
1790 | SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); | 1803 | SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); |
1791 | if (part == null) | 1804 | if (part == null) |
@@ -1805,9 +1818,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1805 | return null; | 1818 | return null; |
1806 | } | 1819 | } |
1807 | 1820 | ||
1808 | AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, | 1821 | AssetBase asset |
1809 | Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"), | 1822 | = CreateAsset( |
1810 | agentID); | 1823 | itemBase.Name, |
1824 | itemBase.Description, | ||
1825 | (sbyte)itemBase.AssetType, | ||
1826 | Encoding.ASCII.GetBytes(scriptText), | ||
1827 | agentID); | ||
1828 | |||
1811 | AssetService.Store(asset); | 1829 | AssetService.Store(asset); |
1812 | 1830 | ||
1813 | TaskInventoryItem taskItem = new TaskInventoryItem(); | 1831 | TaskInventoryItem taskItem = new TaskInventoryItem(); |