refactor: In llRemoveInventory() use existing GetInventoryItem() method rather than have it iterate through TaskInventory itself.
parent
58b13d51a7
commit
ae64d089c6
|
@ -3934,20 +3934,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
if (item == null)
|
||||||
{
|
return;
|
||||||
if (item.Name == name)
|
|
||||||
{
|
if (item.ItemID == m_item.ItemID)
|
||||||
if (item.ItemID == m_item.ItemID)
|
throw new ScriptDeleteException();
|
||||||
throw new ScriptDeleteException();
|
else
|
||||||
else
|
m_host.Inventory.RemoveInventoryItem(item.ItemID);
|
||||||
m_host.Inventory.RemoveInventoryItem(item.ItemID);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llSetText(string text, LSL_Vector color, double alpha)
|
public void llSetText(string text, LSL_Vector color, double alpha)
|
||||||
|
|
Loading…
Reference in New Issue