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