diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9908a39..6438bcc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -284,23 +284,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
284 | 284 | ||
285 | protected UUID InventoryKey(string name, int type) | 285 | protected UUID InventoryKey(string name, int type) |
286 | { | 286 | { |
287 | m_host.AddScriptLPS(1); | 287 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); |
288 | 288 | ||
289 | lock (m_host.TaskInventory) | 289 | if (item != null && item.Type == type) |
290 | { | 290 | return item.AssetID; |
291 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) | 291 | else |
292 | { | 292 | return UUID.Zero; |
293 | if (inv.Value.Name == name) | ||
294 | { | ||
295 | if (inv.Value.Type != type) | ||
296 | return UUID.Zero; | ||
297 | |||
298 | return inv.Value.AssetID; | ||
299 | } | ||
300 | } | ||
301 | } | ||
302 | |||
303 | return UUID.Zero; | ||
304 | } | 293 | } |
305 | 294 | ||
306 | /// <summary> | 295 | /// <summary> |
@@ -1707,14 +1696,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1707 | 1696 | ||
1708 | return rgb; | 1697 | return rgb; |
1709 | } | 1698 | } |
1699 | |||
1710 | if (face >= 0 && face < GetNumberOfSides(part)) | 1700 | if (face >= 0 && face < GetNumberOfSides(part)) |
1711 | { | 1701 | { |
1712 | texcolor = tex.GetFace((uint)face).RGBA; | 1702 | texcolor = tex.GetFace((uint)face).RGBA; |
1713 | rgb.x = texcolor.R; | 1703 | rgb.x = texcolor.R; |
1714 | rgb.y = texcolor.G; | 1704 | rgb.y = texcolor.G; |
1715 | rgb.z = texcolor.B; | 1705 | rgb.z = texcolor.B; |
1706 | |||
1716 | return rgb; | 1707 | return rgb; |
1717 | |||
1718 | } | 1708 | } |
1719 | else | 1709 | else |
1720 | { | 1710 | { |