aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-04 21:25:58 +0100
committerJustin Clark-Casey (justincc)2012-07-04 21:25:58 +0100
commit0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a (patch)
treef0a90292665e01a9529d4d506dc13ecbd700eaa0
parentIn llMessageLinked() use GetInventoryItems() rather than cloning TaskInventor... (diff)
downloadopensim-SC_OLD-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.zip
opensim-SC_OLD-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.tar.gz
opensim-SC_OLD-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.tar.bz2
opensim-SC_OLD-0e3fce9b5c26ee21dee64f8667e7b47b71dbdb3a.tar.xz
refactor: In llGetInventoryKey() use existing GetInventoryItem()
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs24
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();