refactor: In llGetInventoryKey() use existing GetInventoryItem()
parent
aa1442b07e
commit
72554fc5b8
|
@ -4545,22 +4545,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
|
||||||
{
|
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
if (item == null)
|
||||||
{
|
|
||||||
if (inv.Value.Name == name)
|
|
||||||
{
|
|
||||||
if ((inv.Value.CurrentPermissions & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
|
|
||||||
{
|
|
||||||
return inv.Value.AssetID.ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return UUID.Zero.ToString();
|
return UUID.Zero.ToString();
|
||||||
}
|
|
||||||
}
|
if ((item.CurrentPermissions
|
||||||
}
|
& (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
|
||||||
|
== (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify))
|
||||||
|
{
|
||||||
|
return item.AssetID.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
return UUID.Zero.ToString();
|
return UUID.Zero.ToString();
|
||||||
|
|
Loading…
Reference in New Issue