From a3316f1eac5d2becacc524e61e8991bf90e27c1f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Oct 2011 00:07:52 +0100 Subject: [PATCH] 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! --- .../Shared/Api/Implementation/LSL_Api.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9a26f4b79a..8291105b0b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1912,11 +1912,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); - return texface.TextureID.ToString(); + string texture = texface.TextureID.ToString(); + + lock (part.TaskInventory) + { + foreach (KeyValuePair inv in part.TaskInventory) + { + if (inv.Value.AssetID == texface.TextureID) + { + texture = inv.Value.Name.ToString(); + break; + } + } + } + + return texture; } else {