refactor: In llGetInventoryCreator() use existing GetInventoryItem()

0.7.4.1
Justin Clark-Casey (justincc) 2012-07-04 21:49:21 +01:00
parent d933bdbd59
commit f2b0377c28
1 changed files with 8 additions and 12 deletions

View File

@ -9093,26 +9093,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public LSL_String llGetInventoryCreator(string item)
public LSL_String llGetInventoryCreator(string itemName)
{
m_host.AddScriptLPS(1);
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == item)
{
return inv.Value.CreatorID.ToString();
}
}
}
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
if (item == null)
{
llSay(0, "No item name '" + item + "'");
return String.Empty;
}
return item.CreatorID.ToString();
}
public void llOwnerSay(string msg)
{
m_host.AddScriptLPS(1);