diff options
author | Justin Clark-Casey (justincc) | 2012-07-04 21:33:35 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-04 21:33:35 +0100 |
commit | dff7cae2ee78942d97f8481b16e0f682dfcce038 (patch) | |
tree | ea50a492f84edfc3e4cfa51c3e5e1f4f03152715 /OpenSim/Region | |
parent | refactor: In llGetInventoryKey() use existing GetInventoryItem() (diff) | |
download | opensim-SC_OLD-dff7cae2ee78942d97f8481b16e0f682dfcce038.zip opensim-SC_OLD-dff7cae2ee78942d97f8481b16e0f682dfcce038.tar.gz opensim-SC_OLD-dff7cae2ee78942d97f8481b16e0f682dfcce038.tar.bz2 opensim-SC_OLD-dff7cae2ee78942d97f8481b16e0f682dfcce038.tar.xz |
refactor: replace use of LSL_Api.GetTaskInventoryItem() with existing GetInventoryItem()
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b0602fc..813fffd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -6296,20 +6296,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6296 | } | 6296 | } |
6297 | } | 6297 | } |
6298 | 6298 | ||
6299 | protected UUID GetTaskInventoryItem(string name) | ||
6300 | { | ||
6301 | lock (m_host.TaskInventory) | ||
6302 | { | ||
6303 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) | ||
6304 | { | ||
6305 | if (inv.Value.Name == name) | ||
6306 | return inv.Key; | ||
6307 | } | ||
6308 | } | ||
6309 | |||
6310 | return UUID.Zero; | ||
6311 | } | ||
6312 | |||
6313 | public void llGiveInventoryList(string destination, string category, LSL_List inventory) | 6299 | public void llGiveInventoryList(string destination, string category, LSL_List inventory) |
6314 | { | 6300 | { |
6315 | m_host.AddScriptLPS(1); | 6301 | m_host.AddScriptLPS(1); |
@@ -6322,16 +6308,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6322 | 6308 | ||
6323 | foreach (Object item in inventory.Data) | 6309 | foreach (Object item in inventory.Data) |
6324 | { | 6310 | { |
6311 | string rawItemString = item.ToString(); | ||
6312 | |||
6325 | UUID itemID; | 6313 | UUID itemID; |
6326 | if (UUID.TryParse(item.ToString(), out itemID)) | 6314 | if (UUID.TryParse(rawItemString, out itemID)) |
6327 | { | 6315 | { |
6328 | itemList.Add(itemID); | 6316 | itemList.Add(itemID); |
6329 | } | 6317 | } |
6330 | else | 6318 | else |
6331 | { | 6319 | { |
6332 | itemID = GetTaskInventoryItem(item.ToString()); | 6320 | TaskInventoryItem taskItem = m_host.Inventory.GetInventoryItem(rawItemString); |
6333 | if (itemID != UUID.Zero) | 6321 | |
6334 | itemList.Add(itemID); | 6322 | if (taskItem != null) |
6323 | itemList.Add(taskItem.ItemID); | ||
6335 | } | 6324 | } |
6336 | } | 6325 | } |
6337 | 6326 | ||
@@ -6349,11 +6338,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6349 | Array.Copy(objBytes, 0, bucket, 1, 16); | 6338 | Array.Copy(objBytes, 0, bucket, 1, 16); |
6350 | 6339 | ||
6351 | GridInstantMessage msg = new GridInstantMessage(World, | 6340 | GridInstantMessage msg = new GridInstantMessage(World, |
6352 | m_host.UUID, m_host.Name+", an object owned by "+ | 6341 | m_host.UUID, m_host.Name + ", an object owned by " + |
6353 | resolveName(m_host.OwnerID)+",", destID, | 6342 | resolveName(m_host.OwnerID) + ",", destID, |
6354 | (byte)InstantMessageDialog.InventoryOffered, | 6343 | (byte)InstantMessageDialog.InventoryOffered, |
6355 | false, category+"\n"+m_host.Name+" is located at "+ | 6344 | false, category + "\n" + m_host.Name + " is located at " + |
6356 | World.RegionInfo.RegionName+" "+ | 6345 | World.RegionInfo.RegionName + " " + |
6357 | m_host.AbsolutePosition.ToString(), | 6346 | m_host.AbsolutePosition.ToString(), |
6358 | folderID, true, m_host.AbsolutePosition, | 6347 | folderID, true, m_host.AbsolutePosition, |
6359 | bucket); | 6348 | bucket); |