mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
refactor: replace LSL_Api.InventoryKey(string) largely with SceneObjectPartInventory.GetInventoryItem(string)
Also gets llStopAnimation() to call KeyOrName rather than duplicating logic.
This commit is contained in:
@@ -582,14 +582,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return item;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get inventory items by name.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns>
|
||||
/// A list of inventory items with that name.
|
||||
/// If no inventory item has that name then an empty list is returned.
|
||||
/// </returns>
|
||||
public TaskInventoryItem GetInventoryItem(string name)
|
||||
{
|
||||
lock (m_items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Name == name)
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<TaskInventoryItem> GetInventoryItems(string name)
|
||||
{
|
||||
List<TaskInventoryItem> items = new List<TaskInventoryItem>();
|
||||
|
||||
Reference in New Issue
Block a user