For llGetTexture(), if the face texture asset is in the inventory, return the inventory name rather than the asset UUID

This is as per http://wiki.secondlife.com/wiki/LlGetTexture
Applied patch in http://opensimulator.org/mantis/view.php?id=4552 with an additional break statement if an inventory item is found to exit early.
Thanks Michelle Argus!
remove-scene-viewer
Justin Clark-Casey (justincc) 2011-10-04 00:07:52 +01:00
parent 34026887fe
commit 8a6e6866d9
1 changed files with 16 additions and 1 deletions

View File

@ -1912,11 +1912,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
face = 0; face = 0;
} }
if (face >= 0 && face < GetNumberOfSides(part)) if (face >= 0 && face < GetNumberOfSides(part))
{ {
Primitive.TextureEntryFace texface; Primitive.TextureEntryFace texface;
texface = tex.GetFace((uint)face); texface = tex.GetFace((uint)face);
return texface.TextureID.ToString(); string texture = texface.TextureID.ToString();
lock (part.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in part.TaskInventory)
{
if (inv.Value.AssetID == texface.TextureID)
{
texture = inv.Value.Name.ToString();
break;
}
}
}
return texture;
} }
else else
{ {