refactor: In llGetInventoryType() use existing GetInventoryItem()

0.7.4.1
Justin Clark-Casey (justincc) 2012-07-04 21:50:52 +01:00
parent f2b0377c28
commit 9fac7fd932
1 changed files with 5 additions and 11 deletions

View File

@ -9656,18 +9656,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == name)
{
return inv.Value.Type;
}
}
}
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
return -1;
if (item == null)
return -1;
return item.Type;
}
public void llSetPayPrice(int price, LSL_List quick_pay_buttons)