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
This commit is contained in:
Charles Krinke
2008-06-26 02:46:29 +00:00
parent 76e24d02ad
commit 1cd6b71b60
4 changed files with 192 additions and 68 deletions

View File

@@ -36,6 +36,7 @@ using Axiom.Math;
using libsecondlife;
using OpenSim;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney;
@@ -4226,10 +4227,45 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
NotImplemented("llGroundRepel");
}
private LLUUID GetTaskInventoryItem(string name)
{
foreach (KeyValuePair<LLUUID, TaskInventoryItem> 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<LLUUID> itemList = new List<LLUUID>();
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)