aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs22
2 files changed, 27 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 30ed7d1..4370fcc 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -164,6 +164,19 @@ namespace OpenSim.Region.Framework.Interfaces
164 List<TaskInventoryItem> GetInventoryItems(); 164 List<TaskInventoryItem> GetInventoryItems();
165 165
166 /// <summary> 166 /// <summary>
167 /// Gets an inventory item by name
168 /// </summary>
169 /// <remarks>
170 /// This method returns the first inventory item that matches the given name. In SL this is all you need
171 /// since each item in a prim inventory must have a unique name.
172 /// </remarks>
173 /// <param name='name'></param>
174 /// <returns>
175 /// The inventory item. Null if no such item was found.
176 /// </returns>
177 TaskInventoryItem GetInventoryItem(string name);
178
179 /// <summary>
167 /// Get inventory items by name. 180 /// Get inventory items by name.
168 /// </summary> 181 /// </summary>
169 /// <param name="name"></param> 182 /// <param name="name"></param>
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
582 return item; 582 return item;
583 } 583 }
584 584
585 /// <summary> 585 public TaskInventoryItem GetInventoryItem(string name)
586 /// Get inventory items by name. 586 {
587 /// </summary> 587 lock (m_items)
588 /// <param name="name"></param> 588 {
589 /// <returns> 589 foreach (TaskInventoryItem item in m_items.Values)
590 /// A list of inventory items with that name. 590 {
591 /// If no inventory item has that name then an empty list is returned. 591 if (item.Name == name)
592 /// </returns> 592 return item;
593 }
594 }
595
596 return null;
597 }
598
593 public List<TaskInventoryItem> GetInventoryItems(string name) 599 public List<TaskInventoryItem> GetInventoryItems(string name)
594 { 600 {
595 List<TaskInventoryItem> items = new List<TaskInventoryItem>(); 601 List<TaskInventoryItem> items = new List<TaskInventoryItem>();