aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs60
1 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 6e815a6..dd361bf 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -258,32 +258,32 @@ namespace OpenSim.Region.Environment.Scenes
258 } 258 }
259 } 259 }
260 260
261 // Assumes a lock is held on the inventory 261 // Assumes a lock is held on the inventory
262 private bool InventoryContainsName(string name) 262 private bool InventoryContainsName(string name)
263 { 263 {
264 foreach (TaskInventoryItem item in m_taskInventory.Values) 264 foreach (TaskInventoryItem item in m_taskInventory.Values)
265 { 265 {
266 if(item.Name == name) 266 if(item.Name == name)
267 return true; 267 return true;
268 } 268 }
269 return false; 269 return false;
270 } 270 }
271 271
272 private string FindAvailableInventoryName(string name) 272 private string FindAvailableInventoryName(string name)
273 { 273 {
274 if(!InventoryContainsName(name)) 274 if(!InventoryContainsName(name))
275 return name; 275 return name;
276 276
277 int suffix=1; 277 int suffix=1;
278 while(suffix < 256) 278 while(suffix < 256)
279 { 279 {
280 string tryName=String.Format("{0} {1}", name, suffix); 280 string tryName=String.Format("{0} {1}", name, suffix);
281 if(!InventoryContainsName(tryName)) 281 if(!InventoryContainsName(tryName))
282 return tryName; 282 return tryName;
283 suffix++; 283 suffix++;
284 } 284 }
285 return String.Empty; 285 return String.Empty;
286 } 286 }
287 287
288 /// <summary> 288 /// <summary>
289 /// Add an item to this prim's inventory. 289 /// Add an item to this prim's inventory.
@@ -295,11 +295,11 @@ namespace OpenSim.Region.Environment.Scenes
295 item.CreationDate = 1000; 295 item.CreationDate = 1000;
296 item.ParentPartID = UUID; 296 item.ParentPartID = UUID;
297 297
298 string name=FindAvailableInventoryName(item.Name); 298 string name=FindAvailableInventoryName(item.Name);
299 if(name == String.Empty) 299 if(name == String.Empty)
300 return; 300 return;
301 301
302 item.Name=name; 302 item.Name=name;
303 303
304 lock (m_taskInventory) 304 lock (m_taskInventory)
305 { 305 {