diff options
author | Justin Clark-Casey (justincc) | 2012-07-04 21:25:58 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-04 21:25:58 +0100 |
commit | 0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a (patch) | |
tree | f0a90292665e01a9529d4d506dc13ecbd700eaa0 /OpenSim/Region/ScriptEngine | |
parent | In llMessageLinked() use GetInventoryItems() rather than cloning TaskInventor... (diff) | |
download | opensim-SC-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.zip opensim-SC-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.tar.gz opensim-SC-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.tar.bz2 opensim-SC-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.tar.xz |
refactor: In llGetInventoryKey() use existing GetInventoryItem()
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f57f752..b0602fc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4703,22 +4703,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4703 | { | 4703 | { |
4704 | m_host.AddScriptLPS(1); | 4704 | m_host.AddScriptLPS(1); |
4705 | 4705 | ||
4706 | lock (m_host.TaskInventory) | 4706 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); |
4707 | |||
4708 | if (item == null) | ||
4709 | return UUID.Zero.ToString(); | ||
4710 | |||
4711 | if ((item.CurrentPermissions | ||
4712 | & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) | ||
4713 | == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) | ||
4707 | { | 4714 | { |
4708 | foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory) | 4715 | return item.AssetID.ToString(); |
4709 | { | ||
4710 | if (inv.Value.Name == name) | ||
4711 | { | ||
4712 | if ((inv.Value.CurrentPermissions & (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) == (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify)) | ||
4713 | { | ||
4714 | return inv.Value.AssetID.ToString(); | ||
4715 | } | ||
4716 | else | ||
4717 | { | ||
4718 | return UUID.Zero.ToString(); | ||
4719 | } | ||
4720 | } | ||
4721 | } | ||
4722 | } | 4716 | } |
4723 | 4717 | ||
4724 | return UUID.Zero.ToString(); | 4718 | return UUID.Zero.ToString(); |