mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
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:
@@ -4374,10 +4374,45 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user