refactor: replace use of LSL_Api.GetTaskInventoryItem() with existing GetInventoryItem()
parent
72554fc5b8
commit
0acac2f890
|
@ -6138,20 +6138,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
}
|
||||
|
||||
protected UUID GetTaskInventoryItem(string name)
|
||||
{
|
||||
lock (m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == name)
|
||||
return inv.Key;
|
||||
}
|
||||
}
|
||||
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
public void llGiveInventoryList(string destination, string category, LSL_List inventory)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
@ -6164,16 +6150,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
foreach (Object item in inventory.Data)
|
||||
{
|
||||
string rawItemString = item.ToString();
|
||||
|
||||
UUID itemID;
|
||||
if (UUID.TryParse(item.ToString(), out itemID))
|
||||
if (UUID.TryParse(rawItemString, out itemID))
|
||||
{
|
||||
itemList.Add(itemID);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemID = GetTaskInventoryItem(item.ToString());
|
||||
if (itemID != UUID.Zero)
|
||||
itemList.Add(itemID);
|
||||
TaskInventoryItem taskItem = m_host.Inventory.GetInventoryItem(rawItemString);
|
||||
|
||||
if (taskItem != null)
|
||||
itemList.Add(taskItem.ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue