refactor: In llGetInventoryCreator() use existing GetInventoryItem()

0.7.3-extended
Justin Clark-Casey (justincc) 2012-07-04 21:49:21 +01:00
parent 6ff0e58db7
commit 890f617e58
1 changed files with 8 additions and 12 deletions

View File

@ -8933,26 +8933,22 @@ 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);
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == item)
{
return inv.Value.CreatorID.ToString();
}
}
}
if (item == null)
{
llSay(0, "No item name '" + item + "'"); llSay(0, "No item name '" + item + "'");
return String.Empty; return String.Empty;
} }
return item.CreatorID.ToString();
}
public void llOwnerSay(string msg) public void llOwnerSay(string msg)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);