diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1486e2a..9bece31 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4200,25 +4200,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4200 | { | 4200 | { |
4201 | m_host.AddScriptLPS(1); | 4201 | m_host.AddScriptLPS(1); |
4202 | 4202 | ||
4203 | List<TaskInventoryItem> inv; | ||
4203 | try | 4204 | try |
4204 | { | 4205 | { |
4205 | m_host.TaskInventory.LockItemsForRead(true); | 4206 | m_host.TaskInventory.LockItemsForRead(true); |
4206 | foreach (TaskInventoryItem item in m_host.TaskInventory.Values) | 4207 | inv = new List<TaskInventoryItem>(m_host.TaskInventory.Values); |
4207 | { | ||
4208 | if (item.Name == name) | ||
4209 | { | ||
4210 | if (item.ItemID == m_itemID) | ||
4211 | throw new ScriptDeleteException(); | ||
4212 | else | ||
4213 | m_host.Inventory.RemoveInventoryItem(item.ItemID); | ||
4214 | return; | ||
4215 | } | ||
4216 | } | ||
4217 | } | 4208 | } |
4218 | finally | 4209 | finally |
4219 | { | 4210 | { |
4220 | m_host.TaskInventory.LockItemsForRead(false); | 4211 | m_host.TaskInventory.LockItemsForRead(false); |
4221 | } | 4212 | } |
4213 | foreach (TaskInventoryItem item in inv) | ||
4214 | { | ||
4215 | if (item.Name == name) | ||
4216 | { | ||
4217 | if (item.ItemID == m_itemID) | ||
4218 | throw new ScriptDeleteException(); | ||
4219 | else | ||
4220 | m_host.Inventory.RemoveInventoryItem(item.ItemID); | ||
4221 | return; | ||
4222 | } | ||
4223 | } | ||
4222 | } | 4224 | } |
4223 | 4225 | ||
4224 | public void llSetText(string text, LSL_Vector color, double alpha) | 4226 | public void llSetText(string text, LSL_Vector color, double alpha) |