aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs33
1 files changed, 9 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b43e8e7..084bd41 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3925,11 +3925,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3925 public void llGiveInventory(string destination, string inventory) 3925 public void llGiveInventory(string destination, string inventory)
3926 { 3926 {
3927 m_host.AddScriptLPS(1); 3927 m_host.AddScriptLPS(1);
3928 bool found = false; 3928
3929 UUID destId = UUID.Zero; 3929 UUID destId = UUID.Zero;
3930 UUID objId = UUID.Zero;
3931 int assetType = 0;
3932 string objName = String.Empty;
3933 3930
3934 if (!UUID.TryParse(destination, out destId)) 3931 if (!UUID.TryParse(destination, out destId))
3935 { 3932 {
@@ -3937,28 +3934,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3937 return; 3934 return;
3938 } 3935 }
3939 3936
3940 // move the first object found with this inventory name 3937 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory);
3941 lock (m_host.TaskInventory)
3942 {
3943 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
3944 {
3945 if (inv.Value.Name == inventory)
3946 {
3947 found = true;
3948 objId = inv.Key;
3949 assetType = inv.Value.Type;
3950 objName = inv.Value.Name;
3951 break;
3952 }
3953 }
3954 }
3955 3938
3956 if (!found) 3939 if (item == null)
3957 { 3940 {
3958 llSay(0, String.Format("Could not find object '{0}'", inventory)); 3941 llSay(0, String.Format("Could not find object '{0}'", inventory));
3959 throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); 3942 throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory));
3960 } 3943 }
3961 3944
3945 UUID objId = item.ItemID;
3946
3962 // check if destination is an object 3947 // check if destination is an object
3963 if (World.GetSceneObjectPart(destId) != null) 3948 if (World.GetSceneObjectPart(destId) != null)
3964 { 3949 {
@@ -3990,14 +3975,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3990 3975
3991 if (m_TransferModule != null) 3976 if (m_TransferModule != null)
3992 { 3977 {
3993 byte[] bucket = new byte[] { (byte)assetType }; 3978 byte[] bucket = new byte[] { (byte)item.Type };
3994 3979
3995 GridInstantMessage msg = new GridInstantMessage(World, 3980 GridInstantMessage msg = new GridInstantMessage(World,
3996 m_host.UUID, m_host.Name + ", an object owned by " + 3981 m_host.UUID, m_host.Name + ", an object owned by " +
3997 resolveName(m_host.OwnerID) + ",", destId, 3982 resolveName(m_host.OwnerID) + ",", destId,
3998 (byte)InstantMessageDialog.TaskInventoryOffered, 3983 (byte)InstantMessageDialog.TaskInventoryOffered,
3999 false, objName + "\n" + m_host.Name + " is located at " + 3984 false, item.Name + "\n" + m_host.Name + " is located at " +
4000 World.RegionInfo.RegionName + " " + 3985 World.RegionInfo.RegionName+" "+
4001 m_host.AbsolutePosition.ToString(), 3986 m_host.AbsolutePosition.ToString(),
4002 agentItem.ID, true, m_host.AbsolutePosition, 3987 agentItem.ID, true, m_host.AbsolutePosition,
4003 bucket); 3988 bucket);