protected UUID InventoryKey(string name, bool throwExceptionIfDoesNotExist)
{
lock (m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
if (inv.Value.Name == name)
{
return inv.Value.AssetID;
}
}
}
if (throwExceptionIfDoesNotExist)
{
IChatModule chatModule = World.RequestModuleInterface<IChatModule>();
if (chatModule != null)
chatModule.SimChat("Could not find sound '" + name + "'.",
ChatTypeEnum.DebugChannel, 2147483647, m_host.AbsolutePosition,
m_host.Name, m_host.UUID, false, World);
}
return UUID.Zero;
}