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)
|
protected UUID InventoryKey(string name, int type)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(name);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
if (item != null && item.Type == type)
|
||||||
{
|
return item.AssetID;
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
else
|
||||||
{
|
return UUID.Zero;
|
||||||
if (inv.Value.Name == name)
|
|
||||||
{
|
|
||||||
if (inv.Value.Type != type)
|
|
||||||
return UUID.Zero;
|
|
||||||
|
|
||||||
return inv.Value.AssetID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return UUID.Zero;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1694,12 +1683,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
return rgb;
|
return rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (face >= 0 && face < GetNumberOfSides(part))
|
if (face >= 0 && face < GetNumberOfSides(part))
|
||||||
{
|
{
|
||||||
texcolor = tex.GetFace((uint)face).RGBA;
|
texcolor = tex.GetFace((uint)face).RGBA;
|
||||||
rgb.x = texcolor.R;
|
rgb.x = texcolor.R;
|
||||||
rgb.y = texcolor.G;
|
rgb.y = texcolor.G;
|
||||||
rgb.z = texcolor.B;
|
rgb.z = texcolor.B;
|
||||||
|
|
||||||
return rgb;
|
return rgb;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue