From ff53add54dbc666e585b928ba51b4babb7441611 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 26 May 2012 00:36:01 +0100
Subject: refactor: replace LSL_Api.InventoryKey(string) largely with
SceneObjectPartInventory.GetInventoryItem(string)
Also gets llStopAnimation() to call KeyOrName rather than duplicating logic.
---
.../Framework/Scenes/SceneObjectPartInventory.cs | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index aaf9ffa..8810903 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -582,14 +582,20 @@ namespace OpenSim.Region.Framework.Scenes
return item;
}
- ///
- /// Get inventory items by name.
- ///
- ///
- ///
- /// A list of inventory items with that name.
- /// If no inventory item has that name then an empty list is returned.
- ///
+ 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 GetInventoryItems(string name)
{
List items = new List();
--
cgit v1.1