refactor: In llGetInventoryType() use existing GetInventoryItem()

0.7.3-extended
Justin Clark-Casey (justincc) 2012-07-04 21:50:52 +01:00
parent 890f617e58
commit cf8adbe007
1 changed files with 5 additions and 11 deletions

View File

@ -9496,18 +9496,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)