Use GetInventoryItem() in LSL_Api.InventoryKey(string name, int type).
Also removes small bug where calling this method would add 1 to LPS, evne though all callers already did this.0.7.3-extended
parent
67abbcf269
commit
4d44f2d248
|
@ -273,23 +273,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
protected UUID InventoryKey(string name, int type)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
|
||||
|
||||
lock (m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == name)
|
||||
{
|
||||
if (inv.Value.Type != type)
|
||||
return UUID.Zero;
|
||||
|
||||
return inv.Value.AssetID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return UUID.Zero;
|
||||
if (item != null && item.Type == type)
|
||||
return item.AssetID;
|
||||
else
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1694,12 +1683,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
return rgb;
|
||||
}
|
||||
|
||||
if (face >= 0 && face < GetNumberOfSides(part))
|
||||
{
|
||||
texcolor = tex.GetFace((uint)face).RGBA;
|
||||
rgb.x = texcolor.R;
|
||||
rgb.y = texcolor.G;
|
||||
rgb.z = texcolor.B;
|
||||
|
||||
return rgb;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue