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,24 +8933,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)