From 1cd6b71b60d093b451ba03881ee31efd3eb29a50 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Thu, 26 Jun 2008 02:46:29 +0000 Subject: Mantis#1594. Thank you, Melanie for a patch that: Fixes: - Wearable icon and name sreset to default on copy/paste - Cache is not updated when renaming/moving folders - Partial refactor to make inventory less dependen on AssetBase having a "Name" field - Add llGiveInventoryList() function --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 37 +++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index a9d1309..366b20c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -4374,10 +4374,45 @@ namespace OpenSim.Region.ScriptEngine.Common NotImplemented("llGroundRepel"); } + private LLUUID GetTaskInventoryItem(string name) + { + foreach (KeyValuePair inv in m_host.TaskInventory) + { + if(inv.Value.Name == name) + return inv.Key; + } + return LLUUID.Zero; + } + public void llGiveInventoryList(string destination, string category, LSL_Types.list inventory) { m_host.AddScriptLPS(1); - NotImplemented("llGiveInventoryList"); + + LLUUID destID; + if(!LLUUID.TryParse(destination, out destID)) + return; + + List itemList = new List(); + + foreach (Object item in inventory.Data) + { + LLUUID itemID; + if(LLUUID.TryParse(item.ToString(), out itemID)) + { + itemList.Add(itemID); + } + else + { + itemID = GetTaskInventoryItem(item.ToString()); + if(itemID != LLUUID.Zero) + itemList.Add(itemID); + } + } + + if(itemList.Count == 0) + return; + + m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList); } public void llSetVehicleType(int type) -- cgit v1.1