diff options
author | Justin Clark-Casey (justincc) | 2012-07-04 21:05:51 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-04 21:05:51 +0100 |
commit | ae64d089c669a9f953fc0992ca4de3a700395def (patch) | |
tree | b72a89f51971644155e2ffebd92133be6195067e /OpenSim/Region/ScriptEngine/Shared | |
parent | refactor: make llGiveInventory() use existing GetInventoryItem() method rathe... (diff) | |
download | opensim-SC_OLD-ae64d089c669a9f953fc0992ca4de3a700395def.zip opensim-SC_OLD-ae64d089c669a9f953fc0992ca4de3a700395def.tar.gz opensim-SC_OLD-ae64d089c669a9f953fc0992ca4de3a700395def.tar.bz2 opensim-SC_OLD-ae64d089c669a9f953fc0992ca4de3a700395def.tar.xz |
refactor: In llRemoveInventory() use existing GetInventoryItem() method rather than have it iterate through TaskInventory itself.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8a3efa7..b52ebac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3934,20 +3934,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3934 | { | 3934 | { |
3935 | m_host.AddScriptLPS(1); | 3935 | m_host.AddScriptLPS(1); |
3936 | 3936 | ||
3937 | lock (m_host.TaskInventory) | 3937 | TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name); |
3938 | { | 3938 | |
3939 | foreach (TaskInventoryItem item in m_host.TaskInventory.Values) | 3939 | if (item == null) |
3940 | { | 3940 | return; |
3941 | if (item.Name == name) | 3941 | |
3942 | { | 3942 | if (item.ItemID == m_item.ItemID) |
3943 | if (item.ItemID == m_item.ItemID) | 3943 | throw new ScriptDeleteException(); |
3944 | throw new ScriptDeleteException(); | 3944 | else |
3945 | else | 3945 | m_host.Inventory.RemoveInventoryItem(item.ItemID); |
3946 | m_host.Inventory.RemoveInventoryItem(item.ItemID); | ||
3947 | return; | ||
3948 | } | ||
3949 | } | ||
3950 | } | ||
3951 | } | 3946 | } |
3952 | 3947 | ||
3953 | public void llSetText(string text, LSL_Vector color, double alpha) | 3948 | public void llSetText(string text, LSL_Vector color, double alpha) |